Skip to content

Merge

Merge #1

Workflow file for this run

name: Merge
on:
workflow_run:
workflows: [ "Pull Request Closed" ]
types: [completed]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
codeql:
name: Semantic Code Analysis
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- name: Initialize
uses: github/codeql-action/init@v2
with:
languages: javascript
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
deploys-test:
name: TEST Deployments
environment: test
runs-on: ubuntu-22.04
permissions:
issues: write
strategy:
matrix:
name: [backend, frontend]
include:
- name: backend
- name: frontend
parameters:
-p VITE_USER_POOLS_ID=${{ vars.VITE_USER_POOLS_ID }}
-p VITE_USER_POOLS_WEB_CLIENT_ID=${{ vars.VITE_USER_POOLS_WEB_CLIENT_ID }}
steps:
- uses: bcgov-nr/[email protected]
with:
file: ${{ matrix.name }}/openshift.deploy.yml
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
parameters:
-p ZONE=test -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test
-p NAME=${{ github.event.repository.name }}
${{ matrix.parameters }}
penetration_test: true
penetration_test_artifact: ${{ matrix.name }}
penetration_test_issue: ${{ matrix.name }}
penetration_test_token: ${{ secrets.GITHUB_SECRET }}
deploys-prod:
name: PROD Deployments
needs: [deploys-test]
environment: prod
runs-on: ubuntu-22.04
strategy:
matrix:
name: [backend, frontend]
include:
- name: backend
paratemeters:
-p VITE_USER_POOLS_ID=${{ vars.VITE_USER_POOLS_ID }}
-p VITE_USER_POOLS_WEB_CLIENT_ID=${{ vars.VITE_USER_POOLS_WEB_CLIENT_ID }}
-p VITE_REDIRECT_SIGN_OUT="${{ vars.VITE_REDIRECT_SIGN_OUT }}"
- name: frontend
steps:
- uses: bcgov-nr/[email protected]
with:
file: ${{ matrix.name }}/openshift.deploy.yml
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
parameters:
-p ZONE=prod -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test
-p NAME=${{ github.event.repository.name }}
image-promotions:
name: Promote images to PROD
needs: [deploys-prod]
runs-on: ubuntu-22.04
permissions:
packages: write
steps:
- uses: shrink/actions-docker-registry-tag@v3
with:
registry: ghcr.io
repository: ${{ github.repository }}/frontend
target: test
tags: prod