This repository has been archived by the owner on Aug 19, 2023. It is now read-only.
Feat/silva 152 openshift deplyment #1
This file contains 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: PR | |
on: | |
pull_request: | |
concurrency: | |
# PR open and close use the same group, allowing only one at a time | |
group: pr-${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
init: | |
name: Initialize | |
env: | |
DOMAIN: apps.silver.devops.gov.bc.ca | |
PREFIX: ${{ github.event.repository.name }}-${{ github.event.number }} | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: write | |
steps: | |
- name: PR Greeting | |
uses: bcgov-nr/action-pr-description-add@v1.0.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
add_markdown: | | |
--- | |
Thanks for the PR! | |
Any successful deployments (not always required) will be available below. | |
[Backend](https://${{ env.PREFIX }}-backend.${{ env.DOMAIN }}/) | |
[Frontend](https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}/) | |
[Oracle-API](https://${{ env.PREFIX }}-oracle-api.${{ env.DOMAIN }}/) | |
Once merged, code will be promoted and handed off to following workflow run. | |
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml) | |
- name: OpenShift Init | |
uses: bcgov-nr/action-deployer-openshift@v1.1.1 | |
with: | |
oc_namespace: ${{ vars.OC_NAMESPACE }} | |
oc_server: ${{ vars.OC_SERVER }} | |
oc_token: ${{ secrets.OC_TOKEN }} | |
file: common/openshift.init.yml | |
overwrite: false | |
parameters: | |
-p ZONE=${{ github.event.number }} | |
-p NAME=${{ github.event.repository.name }} | |
triggers: ('frontend/') | |
builds: | |
name: Builds | |
needs: | |
- init | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
strategy: | |
matrix: | |
package: [frontend] | |
include: | |
- package: frontend | |
triggers: ('frontend/') | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: bcgov-nr/action-builder-ghcr@v1.1.2 | |
with: | |
package: ${{ matrix.package }} | |
tag: ${{ github.event.number }} | |
tag_fallback: test | |
token: ${{ secrets.GITHUB_TOKEN }} | |
triggers: ${{ matrix.triggers }} | |
deploys: | |
name: Deploys | |
needs: | |
- builds | |
- init | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
name: [frontend] | |
include: | |
- name: frontend | |
file: frontend/openshift.deploy.yml | |
overwrite: true | |
parameters: | |
-p ... to be defined... VITE_SPAR_BUILD_VERSION=snapshot-${{ github.event.number }} | |
-p ... to be defined... VITE_SERVER_URL=https://nr-spar-${{ github.event.number }}-backend.apps.silver.devops.gov.bc.ca | |
-p ... to be defined... VITE_ORACLE_SERVER_URL=https://nr-spar-${{ github.event.number }}-oracle-api.apps.silver.devops.gov.bc.ca | |
-p ... to be defined... VITE_NRSPARWEBAPP_VERSION=dev | |
-p ... to be defined... VITE_KC_URL=https://test.loginproxy.gov.bc.ca/auth | |
-p ... to be defined... VITE_KC_REALM=standard | |
-p ... to be defined... VITE_KC_CLIENT_ID=seed-planning-test-4296 | |
-p MIN_REPLICAS=1 | |
-p MAX_REPLICAS=1 | |
triggers: ('common/' 'database/' 'backend/' 'frontend/') | |
steps: | |
- uses: bcgov-nr/action-deployer-openshift@v1.1.1 | |
with: | |
file: ${{ matrix.file }} | |
oc_namespace: ${{ vars.OC_NAMESPACE }} | |
oc_server: ${{ vars.OC_SERVER }} | |
oc_token: ${{ secrets.OC_TOKEN }} | |
overwrite: ${{ matrix.overwrite }} | |
penetration_test: false | |
parameters: | |
-p ZONE=${{ github.event.number }} | |
-p NAME=${{ github.event.repository.name }} | |
-p PROMOTE=${{ github.repository }}/${{ matrix.name }}:${{ github.event.number }} | |
${{ matrix.parameters }} | |
triggers: ${{ matrix.triggers }} | |
verification_path: ${{ matrix.verification_path}} |