diff --git a/.github/workflows/image_build_push.yml b/.github/workflows/image_build_push.yml index b19d81285..ad293686e 100644 --- a/.github/workflows/image_build_push.yml +++ b/.github/workflows/image_build_push.yml @@ -90,6 +90,7 @@ jobs: secrets: inherit dispatch: + if: ${{ github.ref_type == 'tag' }} needs: [build] runs-on: ubuntu-latest diff --git a/.github/workflows/reusable_image_build_push.yml b/.github/workflows/reusable_image_build_push.yml index 30b239053..3cffd1d5e 100644 --- a/.github/workflows/reusable_image_build_push.yml +++ b/.github/workflows/reusable_image_build_push.yml @@ -200,7 +200,7 @@ jobs: docker images - name: rename docker image - if: ${{ github.ref_type == 'tag' }} + if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }} run: | if [ "${{ inputs.repo }}" = "op-admin-dashboard" ]; then if [ "${{ github.event_name }}" == "push" ]; then @@ -223,7 +223,7 @@ jobs: fi - name: push docker image - if: ${{ github.ref_type == 'tag' }} + if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }} run: | if [ "${{ inputs.repo }}" = "em-public-dashboard" ]; then if [ "${{ github.event_name }}" == "push" ]; then @@ -249,7 +249,7 @@ jobs: fi - name: Update .env file - if: ${{ github.ref_type == 'tag' }} + if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }} run: | if [ "${{ inputs.repo }}" = "e-mission-server" ]; then echo "SERVER_IMAGE_TAG=${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env @@ -289,7 +289,7 @@ jobs: cat .env - name: Add, Commit, Push changes to .env file - if: ${{ github.ref_type == 'tag' }} + if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }} run: | git config --local user.email "action@github.com" git config --local user.name "Github Actions bot to update .env with latest tags"