Update pipeline to include containers #9
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: | ||
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', '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 }} | ||
kotlin_validate: | ||
name: Validate the kotlin | ||
uses: ministryofjustice/hmpps-github-actions/templates/workflows/kotlin_postgres_integration_tests.yml@v2 | ||
secrets: inherit | ||
with: | ||
postgres_tag: postgres16 | ||
postgres_username: root | ||
postgres_password: dev | ||
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 | ||
needs: | ||
- kotlin_validate | ||
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 }}' | ||
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 }}' | ||
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 }}' |