Merge pull request #11 from bcgov/feat/test-prod-deploy #10
This file contains hidden or 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
name: Merge | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
pr_no: | |
description: "PR-numbered container set to deploy" | |
type: number | |
required: true | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: write # This is required for actions/checkout | |
packages: write | |
env: | |
AWS_REGION: ca-central-1 | |
jobs: | |
vars: | |
name: Set Variables | |
outputs: | |
pr: ${{ steps.pr.outputs.pr || github.event.inputs.pr_no }} | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 1 | |
steps: | |
# Get PR number for squash merges to main | |
- name: PR Number | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
id: pr | |
uses: bcgov-nr/action-get-pr@v0.0.1 | |
deploy-dev: | |
name: Deploy Dev | |
needs: [vars] | |
environment: dev | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Deploy Dev | |
uses: ./.github/workflows/.deploy-env.yml | |
with: | |
environment_name: dev | |
app_env: dev | |
tag: ${{ needs.vars.outputs.pr }} | |
AWS_DEPLOY_ROLE_ARN: ${{ secrets.AWS_DEPLOY_ROLE_ARN }} | |
AWS_LICENSE_PLATE: ${{ secrets.AWS_LICENSE_PLATE }} | |
deploy-test: | |
name: Deploy Test | |
needs: [vars] | |
environment: dev # this is the Github secrets environment name | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Deploy Dev | |
uses: ./.github/workflows/.deploy-env.yml | |
with: | |
environment_name: dev # this is the AWS environment name | |
app_env: test # as multuple environments are deployed to the same AWS environment we separate them by app_env as tags. | |
tag: ${{ needs.vars.outputs.pr }} | |
AWS_DEPLOY_ROLE_ARN: ${{ secrets.AWS_DEPLOY_ROLE_ARN }} | |
AWS_LICENSE_PLATE: ${{ secrets.AWS_LICENSE_PLATE }} | |