diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c21c9c4bd..e11eff353 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -269,3 +269,44 @@ jobs: echo "check if go.mod and go.sum are up to date" go mod tidy git diff --exit-code go.mod go.sum + + docker: + name: docker + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + restic/restic + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: false + context: . + file: docker/Dockerfile + pull: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}