From f2b160444e474ff7c227ae1d8fbb816b148cbf8a Mon Sep 17 00:00:00 2001 From: AnnaShaleva Date: Mon, 21 Mar 2022 18:31:38 +0300 Subject: [PATCH] github: add ability to manually trigger publishing workflow with `latest` tag In case if something goes wrong during release version publishing. --- .github/workflows/publish_to_dockerhub.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_to_dockerhub.yml b/.github/workflows/publish_to_dockerhub.yml index 8266c5693..f109f6a25 100644 --- a/.github/workflows/publish_to_dockerhub.yml +++ b/.github/workflows/publish_to_dockerhub.yml @@ -22,6 +22,10 @@ on: description: 'Push images to DockerHub [default: false; examples: true, false]' required: false default: 'false' + use_latest_tag: + description: 'Use `latest` tag while pushing images to DockerHub (applied to Ubuntu image only) [default: false; examples: true, false]' + required: false + default: 'false' # Environment variables. env: @@ -77,7 +81,7 @@ jobs: run: make image - name: Build image with 'latest' tag - if: ${{ github.event_name == 'release' && github.event.release.target_commitish == 'master' }} + if: ${{ (github.event_name == 'release' && github.event.release.target_commitish == 'master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true' && github.event.inputs.use_latest_tag == 'true') }} run: make image-latest - name: Login to DockerHub @@ -91,7 +95,7 @@ jobs: run: make image-push - name: Push image with 'latest' tag to registry - if: ${{ github.event_name == 'release' && github.event.release.target_commitish == 'master' }} + if: ${{ (github.event_name == 'release' && github.event.release.target_commitish == 'master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true' && github.event.inputs.use_latest_tag == 'true') }} run: make image-push-latest tests_wsc: