[MAN-2071] wip #6102
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: Pipeline [test -> build -> deploy] | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| inputs: | |
| additional_docker_tag: | |
| description: Additional docker tag that can be used to specify stable or testing tags | |
| required: false | |
| default: '' | |
| type: string | |
| push: | |
| description: Push docker image to registry flag | |
| required: true | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: read | |
| packages: write | |
| #concurrency: | |
| # group: ${{ github.workflow }}-${{ github.ref }} | |
| ## This will cancel all running build/test/release pipelines that are not on the main branch | |
| ## If this pipeline is on the main branch, it will wait until existing runs complete | |
| # cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| # main node build workflow | |
| node_build: | |
| name: node build | |
| uses: ./.github/workflows/node_build.yml # WORKFLOW_VERSION | |
| secrets: inherit | |
| with: | |
| install_command: 'npm run setup' | |
| # generic node unit tests - feel free to override with local tests if required | |
| node_unit_tests: | |
| name: node unit tests | |
| uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_unit_tests.yml@v2 # WORKFLOW_VERSION | |
| needs: [node_build] | |
| secrets: inherit | |
| # generic node integration tests using wiremock - feel free to override with local tests if required | |
| node_integration_tests: | |
| name: node integration tests | |
| uses: ./.github/workflows/node_integration_tests.yml # WORKFLOW_VERSION | |
| needs: [node_unit_tests] | |
| secrets: inherit | |
| sonarcloud: | |
| name: SonarCloud | |
| uses: ./.github/workflows/sonarqube.yml | |
| needs: [node_unit_tests, node_integration_tests] | |
| secrets: inherit | |
| helm_lint: | |
| strategy: | |
| matrix: | |
| environments: ['dev', 'preprod', 'prod'] | |
| name: helm lint | |
| uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v2 # WORKFLOW_VERSION | |
| secrets: inherit | |
| with: | |
| environment: ${{ matrix.environments }} | |
| build: | |
| name: Build docker image from hmpps-github-actions | |
| if: github.ref == 'refs/heads/main' | |
| uses: ./.github/workflows/docker_build.yml # WORKFLOW_VERSION | |
| secrets: inherit | |
| needs: | |
| - node_integration_tests | |
| - node_unit_tests | |
| with: | |
| docker_registry: 'ghcr.io' | |
| registry_org: 'ministryofjustice' | |
| push: ${{ inputs.push || true }} | |
| docker_multiplatform: true | |
| deploy_dev: | |
| name: Deploy to the development environment | |
| needs: | |
| - build | |
| - helm_lint | |
| uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 # WORKFLOW_VERSION | |
| secrets: inherit | |
| with: | |
| environment: 'dev' | |
| app_version: '${{ needs.build.outputs.app_version }}' | |
| slack_notification: 'true' # if 'true', it needs a valid NONPROD_RELEASES_SLACK_CHANNEL variable to be set | |
| deploy_preprod: | |
| name: Deploy to pre-production environment | |
| needs: | |
| - build | |
| - deploy_dev | |
| uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 # WORKFLOW_VERSION | |
| secrets: inherit | |
| with: | |
| environment: 'preprod' | |
| app_version: '${{ needs.build.outputs.app_version }}' | |
| slack_notification: 'true' # if 'true', it needs a valid NONPROD_RELEASES_SLACK_CHANNEL variable to be set | |
| deploy_prod: | |
| name: Deploy to production environment | |
| needs: | |
| - build | |
| - deploy_preprod | |
| uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 # WORKFLOW_VERSION | |
| secrets: inherit | |
| with: | |
| environment: 'prod' | |
| app_version: '${{ needs.build.outputs.app_version }}' | |
| slack_notification: 'true' # if 'true', it needs a valid PROD_RELEASES_SLACK_CHANNEL variable to be set |