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!: deprecate deployment configs, remove image streams, add ghcr tags #1126

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
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
120 changes: 53 additions & 67 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,9 @@ jobs:
id: pr
uses: bcgov-nr/[email protected]

images-test:
name: Promote images to TEST
needs: [vars]
runs-on: ubuntu-24.04
strategy:
matrix:
component: [backend, database, frontend, legacy, processor]
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.component }}
target: ${{ needs.vars.outputs.pr}}
tags: test

test-init:
name: TEST Init
needs: [images-test]
needs: [vars]
env:
ZONE: test
URL: forestclient-tst.nrs.gov.bc.ca
Expand All @@ -60,7 +45,7 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p ZONE=${{ env.ZONE }}
-p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }}
-p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }}
-p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }}
Expand Down Expand Up @@ -104,7 +89,7 @@ jobs:

test-deploy:
name: TEST Deployment
needs: [test-init]
needs: [vars, test-init]
env:
URL: forestclient-tst.nrs.gov.bc.ca
ZONE: test
Expand All @@ -123,8 +108,8 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p TAG=${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}

- name: Backup database before update
continue-on-error: true
Expand All @@ -144,8 +129,8 @@ jobs:
oc_version: "4.13"
overwrite: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p TAG=${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}

- name: Deploy Legacy
uses: bcgov-nr/[email protected]
Expand All @@ -158,9 +143,9 @@ jobs:
overwrite: true
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/legacy:${{ env.ZONE }}
-p ENVIRONMENT=${{ secrets.OC_NAMESPACE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p ENVIRONMENT=test

- name: Deploy Processor
uses: bcgov-nr/[email protected]
Expand All @@ -173,8 +158,8 @@ jobs:
overwrite: true
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/processor:${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p BCREGISTRY_URI='https://bcregistry-prod.apigee.net'

- name: Deploy Backend ConfigMap
Expand All @@ -187,7 +172,7 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}

- name: Deploy Backend
uses: bcgov-nr/[email protected]
Expand All @@ -200,8 +185,8 @@ jobs:
overwrite: true
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/backend:${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token'
-p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1'
-p BCREGISTRY_URI='https://bcregistry-prod.apigee.net'
Expand All @@ -217,7 +202,8 @@ jobs:
oc_token: ${{ secrets.OC_TOKEN }}
oc_version: "4.13"
overwrite: true
parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
parameters:
-p ZONE=${{ env.ZONE }}

- name: Deploy Frontend ConfigMap
uses: bcgov-nr/[email protected]
Expand All @@ -229,7 +215,7 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}

- name: Deploy Frontend
uses: bcgov-nr/[email protected]
Expand All @@ -241,8 +227,8 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/frontend:${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }}
-p VITE_NODE_ENV=openshift-${{ env.ZONE }}
-p URL=${{ env.URL }}
Expand All @@ -258,24 +244,9 @@ jobs:
name: Generating Documentation
uses: ./.github/workflows/reusable-doc-gen.yml

images-prod:
name: Promote images to PROD
needs: [test-deploy]
runs-on: ubuntu-24.04
strategy:
matrix:
component: [backend, frontend, legacy, database, processor]
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.component }}
target: test
tags: prod

prod-init:
name: PROD Init
needs: [images-prod]
needs: [vars, test-deploy]
env:
URL: forestclient.nrs.gov.bc.ca
ZONE: prod
Expand All @@ -293,7 +264,7 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p ZONE=${{ env.ZONE }}
-p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }}
-p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }}
-p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }}
Expand All @@ -314,7 +285,7 @@ jobs:

prod-deploy:
name: PROD Deployment
needs: [prod-init]
needs: [vars, prod-init]
env:
PREV: test
ZONE: prod
Expand All @@ -334,8 +305,8 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p TAG=${{ env.PREV }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}

- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
Expand All @@ -361,8 +332,8 @@ jobs:
oc_version: "4.13"
overwrite: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p TAG=${{ env.PREV }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}

- name: Deploy Legacy
uses: bcgov-nr/[email protected]
Expand All @@ -375,10 +346,10 @@ jobs:
overwrite: true
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/legacy:${{ env.PREV }}
-p ENVIRONMENT=${{ secrets.OC_NAMESPACE }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p ENVIRONMENT=prod

- name: Deploy Processor
uses: bcgov-nr/[email protected]
with:
Expand All @@ -390,8 +361,8 @@ jobs:
overwrite: true
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/processor:${{ env.PREV }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p BCREGISTRY_URI='https://bcregistry-prod.apigee.net'

- name: Deploy Backend ConfigMap
Expand All @@ -404,7 +375,7 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }}
-p ZONE=${{ env.ZONE }}

- name: Deploy Backend
uses: bcgov-nr/[email protected]
Expand All @@ -417,8 +388,8 @@ jobs:
overwrite: true
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/backend:${{ env.PREV }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token'
-p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1'
-p BCREGISTRY_URI='https://bcregistry-prod.apigee.net'
Expand Down Expand Up @@ -447,8 +418,8 @@ jobs:
oc_version: "4.13"
overwrite: true
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/frontend:${{ env.PREV }}
-p ZONE=${{ env.ZONE }}
-p TAG=${{ needs.vars.outputs.pr }}
-p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }}
-p VITE_NODE_ENV=openshift-${{ env.ZONE }}
-p URL=${{ env.URL }}
Expand All @@ -459,3 +430,18 @@ jobs:
-p COGNITO_ENVIRONMENT=PROD
-p LANDING_URL='${{ secrets.COGNITO_LOGOUT_URI }}'
-p FRONTEND_URL=${{ env.URL }}

promote-images:
name: Promote images to PROD
needs: [prod-deploy]
runs-on: ubuntu-22.04
strategy:
matrix:
component: [backend, frontend, legacy, database, common, processor]
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.component }}
target: test
tags: prod
Loading
Loading