generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Release events now should continue pipeline via pr (#1615)
- Loading branch information
Showing
1 changed file
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,11 @@ on: | |
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: "PR num of image to deploy" | ||
required: false | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
@@ -14,14 +19,23 @@ jobs: | |
vars: | ||
name: Set Variables | ||
outputs: | ||
release-name: ${{ steps.release-name.outputs.release-name }} | ||
pr: ${{ steps.pr.outputs.pr }} | ||
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 == 'release' }} | ||
id: pr_no | ||
uses: bcgov-nr/[email protected] | ||
- name: PR Number | ||
id: pr | ||
run: echo pr=${{ steps.pr_no.outputs.pr || inputs.pr}} >> $GITHUB_OUTPUT | ||
- name: Release Name | ||
id: release-name | ||
run: | | ||
echo release-name=$(curl https://api.github.com/repos/bcgov/onroutebc/releases/latest | jq -r .tag_name) >> $GITHUB_OUTPUT | ||
promote-images-release: | ||
name: Promote Images - Release | ||
needs: [vars] | ||
|
@@ -37,7 +51,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: | ||
|
@@ -46,7 +60,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 | ||
|
@@ -63,7 +77,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: | ||
|
@@ -72,7 +86,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 | ||
|
@@ -89,5 +103,5 @@ jobs: | |
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository }}/${{ matrix.package }} | ||
target: uat | ||
target: ${{ needs.vars.outputs.pr }} | ||
tags: prod |