From 390cacf980ce45c8c2448217e7d59ca2766c4940 Mon Sep 17 00:00:00 2001 From: p1c2u Date: Thu, 18 Feb 2021 21:46:55 +0000 Subject: [PATCH 1/2] Docker publish github action --- .github/workflows/docker-publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 00000000..d94798af --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,21 @@ +# This workflow will upload Docker image when a release is created +# For more information see: https://github.com/marketplace/actions/docker-build-push-action + +name: Publish docker image + +on: + workflow_dispatch: + release: + types: + - created + +jobs: + publish: + steps: + - name: Publish image + uses: mr-smithers-excellent/docker-build-push@v5 + with: + image: p1c2u/openapi-spec-validator + registry: docker.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} From aeb6fd9349e2ec5bf848502aa809a0e30dbf8f4b Mon Sep 17 00:00:00 2001 From: p1c2u Date: Thu, 18 Feb 2021 22:33:13 +0000 Subject: [PATCH 2/2] publish docker image with official actions --- .github/workflows/docker-publish.yml | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d94798af..734f4f41 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -10,12 +10,32 @@ on: - created jobs: - publish: + docker: + runs-on: ubuntu-latest steps: - - name: Publish image - uses: mr-smithers-excellent/docker-build-push@v5 - with: - image: p1c2u/openapi-spec-validator - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + - uses: actions/checkout@v2 + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: | + p1c2u/openapi-spec-validator + tag-semver: | + {{version}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }}