Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deploying via last merged pr instead of tag promotion #1621

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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