From 14f3b5d2e621186d548c9141ba5633cc837b7c2d Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 3 May 2022 13:55:59 -0400 Subject: [PATCH] Add github workflow to build containers --- .github/workflows/docker-build.yml | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..f242f4ce --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,50 @@ +# This is a GitHub workflow defining a set of jobs with a set of steps. +# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions +name: Build container images + +on: + push: + tags: + - "*" + +jobs: + docker: + name: Publish container images + runs-on: ubuntu-latest + steps: + # Action reference: https://github.com/actions/checkout + - name: Checkout sources + uses: actions/checkout@v2 + + # Action reference: https://github.com/docker/metadata-action + - name: Extract metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: edenhill/kcat + + # Action reference: https://github.com/docker/setup-qemu-action + - name: Set up QEMU (for docker buildx) + uses: docker/setup-qemu-action@v1 + + # Action reference: https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + # Action reference: https://github.com/docker/login-action + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Action reference: https://github.com/docker/build-push-action + - name: Build container image + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} +