From 4c6fce936e2cab6f4994a63f4b032d6882073eab Mon Sep 17 00:00:00 2001 From: odidev Date: Sun, 14 Feb 2021 00:31:49 +0530 Subject: [PATCH] Release docker image for arm64 (#75) * Release docker image for arm64 Signed-off-by: odidev * Update publish CI - Only publish for non-pull-requests - Require test to pass explicitly - Generate tags and labels from non-official Docker action - Make use of cache for build speed Co-authored-by: Dylan Arbour --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 940260c..baab7d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,8 @@ on: push: branches: - main + tags: + - v* jobs: test: @@ -32,3 +34,33 @@ jobs: -e "BUILD_NAME=$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER" concourse-slack-alert-resource:$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER /opt/resource/out $PWD + + publish: + needs: [test, docker-test] + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-buildx-action@v1 + - uses: docker/setup-qemu-action@v1 + - uses: docker/login-action@v1 + with: + registry: docker.io + username: arbourd + password: ${{ secrets.DOCKER_TOKEN }} + + - uses: crazy-max/ghaction-docker-meta@v1 + id: docker_meta + with: + images: docker.io/arbourd/concourse-slack-alert-resource + tag-match: v(.*) + + - name: build and publish image + uses: docker/build-push-action@v2 + with: + cache-from: type=registry,ref=docker.io/arbourd/concourse-slack-alert-resource:latest + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }}