Add node_build and node_unit_test #5
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: Pipeline [test -> build -> deploy] | |
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 }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
helm_lint: | |
strategy: | |
matrix: | |
environments: ['dev', 'test', '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 }} | |
node_build: | |
name: node build | |
uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build.yml@v2 # WORKFLOW_VERSION | |
secrets: inherit | |
# 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 | |
build: | |
name: Build docker image from hmpps-github-actions | |
if: github.ref == 'refs/heads/main' | |
uses: ministryofjustice/hmpps-github-actions/.github/workflows/docker_build.yml@v2 # WORKFLOW_VERSION | |
with: | |
docker_registry: 'ghcr.io' | |
registry_org: 'ministryofjustice' | |
additional_docker_tag: ${{ inputs.additional_docker_tag }} | |
push: ${{ inputs.push || true }} | |
docker_multiplatform: false | |
deploy_dev: | |
name: Deploy to the dev environment | |
if: github.ref == 'refs/heads/main' | |
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 }}' | |
helm_timeout: '5m' | |
deploy_test: | |
name: Deploy to test | |
if: inputs.deploy_to == 'test' | |
needs: | |
- build | |
uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 | |
secrets: inherit | |
with: | |
environment: 'test' | |
app_version: '${{ needs.build.outputs.app_version }}' | |
helm_timeout: '5m' |