From f0ac39a76efef2a8c91b78b327bf3b525fb5a338 Mon Sep 17 00:00:00 2001 From: Benjamin Foote Date: Wed, 4 Aug 2021 13:46:37 -0700 Subject: [PATCH] #406 gh action docker build and push to quay.io --- ...ker-release.yml => docker-release-arm.yml} | 2 +- .github/workflows/docker-release-quayio.yml | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) rename .github/workflows/{docker-release.yml => docker-release-arm.yml} (98%) create mode 100644 .github/workflows/docker-release-quayio.yml diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release-arm.yml similarity index 98% rename from .github/workflows/docker-release.yml rename to .github/workflows/docker-release-arm.yml index ca6d44f3..a28f9f7f 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release-arm.yml @@ -6,7 +6,7 @@ on: - master jobs: - Publish-to-docker: + publish-to-docker-arm: runs-on: ubuntu-latest env: DOCKER_TAG: latest-arm diff --git a/.github/workflows/docker-release-quayio.yml b/.github/workflows/docker-release-quayio.yml new file mode 100644 index 00000000..83dcfa48 --- /dev/null +++ b/.github/workflows/docker-release-quayio.yml @@ -0,0 +1,53 @@ +name: Publish Docker image to Quay.io + +on: + push: + branches: + - master + tags: + - 'v*' + + +jobs: + publish-to-docker-quayio: + runs-on: ubuntu-latest + env: + DOCKER_REPO: quay.io + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to Docker repository + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.DOCKER_REPO }} + username: ${{ secrets.QUAYIO_ROBOT_USERNAME }} + password: ${{ secrets.QUAYIO_ROBOT_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: quay.io/vouch/vouch-proxy + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push Docker image using Dockerfile + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker image using Dockerfile.alpine + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + file: Dockerfile.alpine + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: alpine-${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file