Integrated SonarCloud, dropped CodeClimate, fixed on-pr-closed workflow, dropped CodeQL workflow #1886
Workflow file for this run
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: Pull Request Opened | |
| env: | |
| ACRONYM: pcns | |
| APP_NAME: nr-permitconnect-navigator-service | |
| NAMESPACE_PREFIX: d9d78e | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - 'feature/**' | |
| - 'release/**' | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build & Push | |
| if: "! github.event.pull_request.head.repo.fork" | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build & Push | |
| uses: ./.github/actions/build-push-container | |
| with: | |
| context: . | |
| image_name: ${{ env.APP_NAME }} | |
| github_username: ${{ github.repository_owner }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| deploy-pr-dev: | |
| name: Deploy Pull Request to Dev | |
| environment: | |
| name: pr | |
| url: https://${{ env.ACRONYM }}-dev-pr-${{ github.event.number }}.apps.silver.devops.gov.bc.ca | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 12 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login to OpenShift Cluster | |
| uses: bcgov/action-oc-runner@10033668ef4374d9bb78149faa73e4ccda0e93dd # v1.2.3 | |
| with: | |
| oc_server: ${{ secrets.OPENSHIFT_SERVER }} | |
| oc_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
| oc_namespace: ${{ env.NAMESPACE_PREFIX }}-dev | |
| - name: Deploy to Dev | |
| uses: ./.github/actions/deploy-to-environment | |
| with: | |
| app_name: ${{ env.APP_NAME }} | |
| acronym: ${{ env.ACRONYM }} | |
| environment: pr | |
| job_name: pr-${{ github.event.number }} | |
| namespace_prefix: ${{ env.NAMESPACE_PREFIX }} | |
| namespace_environment: dev | |
| openshift_server: ${{ secrets.OPENSHIFT_SERVER }} | |
| openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
| - name: Run database seeds | |
| shell: bash | |
| run: | | |
| kubectl exec $(oc get pods --selector='app.kubernetes.io/instance=pr-${{ github.event.number }},app.kubernetes.io/name=nr-permitconnect-navigator-service' -o custom-columns=POD:.metadata.name --no-headers | head -1) -- sh -c "cd ./sbin && npx knex seed:run --specific=dev_groups.js" | |
| - name: Release Comment on PR | |
| uses: marocchino/sticky-pull-request-comment@d2ad0de260ae8b0235ce059e63f2949ba9e05943 # v2.9.3 | |
| if: success() | |
| with: | |
| header: release | |
| message: | | |
| Release ${{ github.sha }} deployed at <https://${{ env.ACRONYM }}-dev-pr-${{ github.event.number }}.apps.silver.devops.gov.bc.ca> |