fix for SRS-1333 (#1204) #218
This file contains hidden or 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: Deploy CATS to TEST | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - feat/CATS-test # todo remove before merging | |
| # Workflow dispatch is largely for debugging. | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Image tag set to deploy; e.g. PR number or prod" | |
| type: string | |
| default: 'prod' | |
| concurrency: | |
| group: test | |
| cancel-in-progress: false | |
| jobs: | |
| # https://github.com/bcgov-nr/action-builder-ghcr | |
| get-pr-info: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| pr: ${{ steps.vars.outputs.pr }} | |
| steps: | |
| - id: vars | |
| uses: bcgov-nr/action-get-pr@v0.0.1 | |
| - name: Echo PR number | |
| run: | | |
| echo "PR: ${{ steps.vars.outputs.pr }}" | |
| builds: | |
| name: Builds | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| package: [backend, backend-migration, cats-frontend] | |
| include: | |
| - package: backend | |
| build_file: ./backend/cats/Dockerfile | |
| build_context: backend/cats | |
| - package: backend-migration | |
| build_file: ./backend/cats/Dockerfile-migrations-openshift | |
| build_context: backend/cats | |
| - package: cats-frontend | |
| build_file: ./cats-frontend/Dockerfile | |
| build_context: cats-frontend | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: bcgov-nr/action-builder-ghcr@v2.2.0 | |
| with: | |
| package: ${{ matrix.package }} | |
| # tag: ${{ github.event.number }} | |
| tag: test | |
| tag_fallback: latest | |
| triggers: ('${{ matrix.package }}/') | |
| build_file: ${{ matrix.build_file }} | |
| build_context: ${{ matrix.build_context }} | |
| deploy_db: | |
| name: Deploys Database (test) | |
| uses: ./.github/workflows/.dbdeployer.yml | |
| secrets: inherit | |
| needs: [get-pr-info] | |
| with: | |
| values: 'values-dev.yaml' | |
| app_values: 'values-test.yaml' | |
| environment: test | |
| deploys: | |
| name: Deploys (test) | |
| needs: [builds, get-pr-info, deploy_db] | |
| uses: ./.github/workflows/.deployer.yml | |
| secrets: inherit | |
| with: | |
| values: 'values-test.yaml' | |
| redirect_uri: https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://epd-keycloak-test.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/protocol/openid-connect/logout?post_logout_redirect_uri=https://nr-epd-digital-services-${{ github.event.pull_request.number}}-frontend.apps.silver.devops.gov.bc.ca/ | |
| db_user: cats | |
| timeout-minutes: 20 | |
| environment: test | |
| results: | |
| name: PR Results | |
| needs: [builds, deploys] | |
| if: always() | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - if: contains(needs.*.result, 'failure') | |
| run: echo "At least one job has failed." && exit 1 | |
| - run: echo "Success!" |