diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 6290779b1..04fc4c78d 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -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 @@ -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) @@ -43,6 +53,7 @@ jobs: with: environment: test db_user: app + tag: ${{ needs.var.outputs.tag }} deploy-prod: name: Deploy (prod) @@ -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 @@ -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