Fixing up Dockerfile, adding github action to build image #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker image | |
# Shamelessly cribbed from https://docs.docker.com/build/ci/github-actions/test-before-push/ | |
# with minor modifications | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
TEST_TAG: user/app:test | |
LATEST_TAG: user/app:latest | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fixup checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Try something | |
run: git describe --tags | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
load: true | |
tags: ${{ env.TEST_TAG }} | |
- name: Test | |
run: | | |
docker run --rm ${{ env.TEST_TAG }} -c "fit_dataset --help" |