Skip to content

Commit

Permalink
github: add ability to manually trigger publishing workflow with `lat…
Browse files Browse the repository at this point in the history
…est` tag

In case if something goes wrong during release version publishing.
  • Loading branch information
AnnaShaleva committed Mar 21, 2022
1 parent abb1901 commit f2b1604
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/publish_to_dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit f2b1604

Please sign in to comment.