Skip to content

Commit cbd1342

Browse files
authored
ci: merge workflow_dispatch input (#2206)
1 parent 3fcbdc6 commit cbd1342

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/merge.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ on:
1010
- '!.github/workflows/**'
1111
workflow_dispatch:
1212
inputs:
13-
pr_no:
14-
description: "PR-numbered container set to deploy"
15-
type: number
16-
required: true
13+
tag:
14+
description: "Tag set to deploy; e.g. PR number, latest or prod (default)"
15+
type: string
16+
default: 'prod'
1717

1818
concurrency:
1919
# Do not interrupt previous workflows
@@ -24,15 +24,25 @@ jobs:
2424
vars:
2525
name: Set Variables
2626
outputs:
27-
pr: ${{ steps.pr.outputs.pr }}
27+
tag: ${{ steps.tag.outputs.tag }}
2828
runs-on: ubuntu-24.04
2929
timeout-minutes: 1
3030
steps:
3131
# Get PR number for squash merges to main
3232
- name: PR Number
33+
if: ${{ ! inputs.tag }}
3334
id: pr
3435
uses: bcgov-nr/[email protected]
3536

37+
- name: Set Tag
38+
id: tag
39+
run: |
40+
if [ -z "${{ inputs.pr_no }}" ]; then
41+
echo "tag=${{ steps.pr.outputs.pr }}" >> $GITHUB_ENV
42+
else
43+
echo "tag=${{ inputs.tag }}" >> $GITHUB_ENV
44+
fi
45+
3646
# https://github.com/bcgov/quickstart-openshift-helpers
3747
deploy-test:
3848
name: Deploy (test)
@@ -43,6 +53,7 @@ jobs:
4353
with:
4454
environment: test
4555
db_user: app
56+
tag: ${{ needs.var.outputs.tag }}
4657

4758
deploy-prod:
4859
name: Deploy (prod)
@@ -60,6 +71,7 @@ jobs:
6071
--set global.autoscaling=true
6172
--set frontend.pdb.enabled=true
6273
--set backend.pdb.enabled=true
74+
tag: ${{ needs.var.outputs.tag }}
6375

6476
promote:
6577
name: Promote Images
@@ -76,5 +88,5 @@ jobs:
7688
with:
7789
registry: ghcr.io
7890
repository: ${{ github.repository }}/${{ matrix.package }}
79-
target: ${{ needs.vars.outputs.pr }}
91+
target: ${{ needs.var.outputs.tag }}
8092
tags: prod

0 commit comments

Comments
 (0)