feat: legacy #3
Workflow file for this run
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: Pull Request Legacy | |
on: | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
# PR open and close use the same group, allowing only one at a time | |
group: ${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
vars: | |
name: Variables | |
runs-on: ubuntu-latest | |
outputs: | |
semver: ${{ steps.semver.outputs.tag }} | |
url: ${{ steps.calculate.outputs.url }} | |
steps: | |
# steps.semver.outputs.tag => needs.vars.outputs.semver | |
- uses: actions/checkout@v4 | |
with: | |
ref: refs/heads/${{ github.event.repository.default_branch }} | |
- name: Conventional Changelog Update | |
uses: TriPSs/conventional-changelog-action@v5.3.0 | |
id: semver | |
with: | |
git-branch: refs/heads/${{ github.head_ref }} | |
git-push: 'false' | |
skip-commit: 'true' | |
skip-on-empty: 'false' | |
skip-version-file: 'true' | |
# steps.calculate.outputs.url => needs.vars.outputs.url | |
- name: Calculate the deployment number | |
id: calculate | |
run: | | |
echo "url=${{ github.event.repository.name }}-$((${{ github.event.number }} % 50))-frontend.apps.silver.devops.gov.bc.ca" >> $GITHUB_OUTPUT | |
- run: | | |
echo "semver=${{ steps.semver.outputs.tag }}" | |
echo "url=${{ steps.calculate.outputs.url }}" | |
builds: | |
name: Builds | |
runs-on: ubuntu-22.04 | |
needs: [vars] | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bcgov-nr/action-builder-ghcr@v2.1.0 | |
name: Build (Legacy db) | |
with: | |
package: legacydb | |
build_file: ./database/Dockerfile.legacy | |
tag: ${{ github.event.number }} | |
tag_fallback: test | |
triggers: ('database/') | |
build_args: | | |
APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} | |
deploy: | |
name: Deploy Application | |
needs: [builds, vars] | |
environment: dev | |
env: | |
DOMAIN: apps.silver.devops.gov.bc.ca | |
PREFIX: ${{ needs.vars.outputs.url }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Initializing Deployment | |
uses: bcgov-nr/action-deployer-openshift@v2.3.0 | |
with: | |
file: common/openshift.init.yml | |
oc_namespace: ${{ secrets.OC_NAMESPACE }} | |
oc_server: ${{ secrets.OC_SERVER }} | |
oc_token: ${{ secrets.OC_TOKEN }} | |
overwrite: true | |
parameters: | |
-p ZONE=${{ github.event.number }} | |
-p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} | |
-p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} | |
-p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} | |
-p ORACLEDB_PASSWORD_W=${{ secrets.ORACLEDB_PASSWORD_W }} | |
-p ORACLEDB_DATABASE=${{ secrets.ORACLEDB_DATABASE }} | |
-p ORACLEDB_HOST=${{ secrets.ORACLEDB_HOST }} | |
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }} | |
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }} | |
-p BCREGISTRY_KEY=${{ secrets.BCREGISTRY_KEY }} | |
-p BCREGISTRY_ACCOUNT=${{ secrets.BCREGISTRY_ACCOUNT }} | |
-p CHES_CLIENT_ID=${{ secrets.CHES_CLIENT_ID }} | |
-p CHES_CLIENT_SECRET=${{ secrets.CHES_CLIENT_SECRET }} | |
-p ADDRESS_COMPLETE_KEY=${{ secrets.ADDRESS_COMPLETE_KEY }} | |
-p DB_PASSWORD=$(echo ${{github.ref}}${{github.event.number}}|md5sum|cut -d' ' -f1) | |
-p COGNITO_USER_POOL=${{ secrets.COGNITO_USER_POOL }} | |
-p COGNITO_ENVIRONMENT=DEV | |
-p CHES_MAIL_COPY=${{ secrets.CHES_MAIL_COPY }} | |
- name: Deploy Database Legacy | |
uses: bcgov-nr/action-deployer-openshift@v2.3.0 | |
with: | |
file: database/openshift.legacy.yml | |
oc_namespace: ${{ secrets.OC_NAMESPACE }} | |
oc_server: ${{ secrets.OC_SERVER }} | |
oc_token: ${{ secrets.OC_TOKEN }} | |
overwrite: false | |
parameters: | |
-p ZONE=${{ github.event.number }} | |
-p PROMOTE=${{ github.repository }}/legacydb:${{ github.event.number }} |