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

ci: merge workflow_dispatch input #2206

Merged
merged 4 commits into from
Dec 12, 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
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
Loading