-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HEAT-313 - implement Github workflows for test -> build -> deploy (#245)
- Loading branch information
1 parent
3924337
commit f0e66c3
Showing
4 changed files
with
122 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Pipeline [test -> build -> deploy] | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: Environment | ||
type: choice | ||
required: true | ||
options: | ||
- dev | ||
- preprod | ||
- staging | ||
- production | ||
default: 'dev' | ||
docker_registry: | ||
description: Docker registry | ||
required: true | ||
default: 'ghcr.io' | ||
type: choice | ||
options: | ||
- 'ghcr.io' | ||
- 'quay.io' | ||
registry_org: | ||
description: Docker registry organisation | ||
required: true | ||
default: 'ministryofjustice' | ||
type: choice | ||
options: | ||
- 'ministryofjustice' | ||
- 'hmpps' | ||
additional_docker_tag: | ||
description: Additional docker tag that can be used to specify stable tags | ||
required: false | ||
default: '' | ||
type: string | ||
push: | ||
description: Push docker image to registry flag | ||
required: true | ||
default: true | ||
type: boolean | ||
docker_multiplatform: | ||
description: docker multiplatform build or not | ||
required: true | ||
default: true | ||
type: boolean | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
helm_lint: | ||
name: helm lint | ||
uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v1 # WORKFLOW VERSION | ||
secrets: inherit | ||
with: | ||
environment: ${{ inputs.environment || 'dev' }} | ||
kotlin_validate: | ||
name: Validate the kotlin | ||
uses: ministryofjustice/hmpps-github-actions/.github/workflows/kotlin_validate.yml@v1 # WORKFLOW_VERSION | ||
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@v1 # WORKFLOW_VERSION | ||
needs: | ||
- kotlin_validate | ||
with: | ||
docker_registry: ${{ inputs.docker_registry || 'ghcr.io' }} | ||
registry_org: ${{ inputs.registry_org || 'ministryofjustice' }} | ||
additional_docker_tag: ${{ inputs.additional_docker_tag }} | ||
push: ${{ inputs.push || true }} | ||
docker_multiplatform: ${{ inputs.docker_multiplatform || true }} | ||
deploy_dev: | ||
name: Deploy to dev environment | ||
needs: | ||
- build | ||
- helm_lint | ||
uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v1 # 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@v1 # 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@v1 # WORKFLOW_VERSION | ||
# secrets: inherit | ||
# with: | ||
# environment: 'prod' | ||
# app_version: '${{ needs.build.outputs.app_version }}' |
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
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