Skip to content

Commit

Permalink
ci: merge workflow_dispatch input (#2206)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Dec 12, 2024
1 parent 3fcbdc6 commit cbd1342
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
- '!.github/workflows/**'
workflow_dispatch:
inputs:
pr_no:
description: "PR-numbered container set to deploy"
type: number
required: true
tag:
description: "Tag set to deploy; e.g. PR number, latest or prod (default)"
type: string
default: 'prod'

concurrency:
# Do not interrupt previous workflows
Expand All @@ -24,15 +24,25 @@ jobs:
vars:
name: Set Variables
outputs:
pr: ${{ steps.pr.outputs.pr }}
tag: ${{ steps.tag.outputs.tag }}
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
# Get PR number for squash merges to main
- name: PR Number
if: ${{ ! inputs.tag }}
id: pr
uses: bcgov-nr/action-get-pr@v0.0.1

- name: Set Tag
id: tag
run: |
if [ -z "${{ inputs.pr_no }}" ]; then
echo "tag=${{ steps.pr.outputs.pr }}" >> $GITHUB_ENV
else
echo "tag=${{ inputs.tag }}" >> $GITHUB_ENV
fi
# https://github.com/bcgov/quickstart-openshift-helpers
deploy-test:
name: Deploy (test)
Expand All @@ -43,6 +53,7 @@ jobs:
with:
environment: test
db_user: app
tag: ${{ needs.var.outputs.tag }}

deploy-prod:
name: Deploy (prod)
Expand All @@ -60,6 +71,7 @@ jobs:
--set global.autoscaling=true
--set frontend.pdb.enabled=true
--set backend.pdb.enabled=true
tag: ${{ needs.var.outputs.tag }}

promote:
name: Promote Images
Expand All @@ -76,5 +88,5 @@ jobs:
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ needs.vars.outputs.pr }}
target: ${{ needs.var.outputs.tag }}
tags: prod

0 comments on commit cbd1342

Please sign in to comment.