Skip to content

Commit

Permalink
fix: deploying via last merged pr instead of tag promotion (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot authored Sep 25, 2024
1 parent b453ac4 commit 61ede22
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ jobs:
vars:
name: Set Variables
outputs:
pr: ${{ steps.pr.outputs.pr }}
release-name: ${{ steps.release-name.outputs.release-name }}
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
# Get PR number for squash merges to main
- name: Get PR Number From Event
if: ${{ github.event_name == 'push' }}
id: pr_no
uses: bcgov-nr/action-get-pr@main
- name: PR Number
id: pr
run: echo pr=${{ steps.pr_no.outputs.pr || inputs.pr}} >> $GITHUB_OUTPUT
- name: Release Name
id: release-name
run: |
Expand All @@ -38,7 +47,7 @@ jobs:
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: test
target: ${{ needs.vars.outputs.pr }}
tags: ${{ needs.vars.outputs.release-name }}

deploys-uat:
Expand All @@ -47,7 +56,7 @@ jobs:
uses: ./.github/workflows/uat.yml
secrets: inherit
with:
tag: ${{ needs.vars.outputs.release-name }}
tag: ${{ needs.vars.outputs.pr }}

promote-images-uat:
name: Promote Images - Uat
Expand All @@ -64,7 +73,7 @@ jobs:
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ needs.vars.outputs.release-name }}
target: ${{ needs.vars.outputs.pr }}
tags: uat

deploys-prod:
Expand All @@ -73,7 +82,7 @@ jobs:
uses: ./.github/workflows/prod.yml
secrets: inherit
with:
tag: ${{ needs.vars.outputs.release-name }}
tag: ${{ needs.vars.outputs.pr }}

promote-images-prod:
name: Promote Images - Prod
Expand All @@ -90,5 +99,5 @@ jobs:
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ needs.vars.outputs.release-name }}
target: ${{ needs.vars.outputs.pr }}
tags: prod

0 comments on commit 61ede22

Please sign in to comment.