Skip to content

COMPENF-391-API (#101) #85

COMPENF-391-API (#101)

COMPENF-391-API (#101) #85

Workflow file for this run

name: Merge to Main
on:
push:
branches:
- main
paths-ignore:
- ".github/ISSUE_TEMPLATE/*"
- "**.md"
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@v3
- 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
needs:
- codeql
environment: test
runs-on: ubuntu-22.04
strategy:
matrix:
name: [backend, database, frontend, init]
include:
- name: backend
file: backend/openshift.deploy.yml
parameters: -p PROMOTE_MIGRATION=${{ github.repository }}/database-migrations:test
overwrite: true
- name: database
file: database/openshift.deploy.yml
overwrite: false
- name: frontend
file: frontend/openshift.deploy.yml
parameters: -p KEYCLOAK_URL=${{ vars.KEYCLOAK_URL_TEST}}
overwrite: true
- name: init
file: common/openshift.init.yml
overwrite: false
steps:
- uses: bcgov-nr/[email protected]
with:
file: ${{ matrix.file }}
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: ${{ matrix.overwrite }}
parameters:
-p ZONE=test -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test
-p NAME=${{ github.event.repository.name }} ${{ matrix.parameters }}
penetration_test: true
deploys-prod:
name: PROD Deployments
needs:
- deploys-test
environment: prod
runs-on: ubuntu-22.04
strategy:
matrix:
name: [backend, database, frontend, init]
include:
- name: backend
file: backend/openshift.deploy.yml
parameters: -p PROMOTE_MIGRATION=${{ github.repository }}/database-migrations:test
overwrite: true
- name: database
file: database/openshift.deploy.yml
overwrite: false
- name: frontend
file: frontend/openshift.deploy.yml
parameters: -p KEYCLOAK_URL=${{ vars.KEYCLOAK_URL_PROD}}
overwrite: true
- name: init
file: common/openshift.init.yml
overwrite: false
steps:
- uses: bcgov-nr/[email protected]
with:
file: ${{ matrix.file }}
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: ${{ matrix.overwrite }}
parameters:
-p ZONE=prod -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test
-p NAME=${{ github.event.repository.name }} ${{ matrix.parameters }}
penetration_test: false
image-promotions:
name: Promote images to PROD
needs:
- deploys-prod
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
component: [backend, database, database-migrations, frontend]
steps:
- uses: shrink/actions-docker-registry-tag@v3
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.component }}
target: test
tags: prod