-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HEAT-313 - implement Github workflows for test -> build -> deploy #245
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6fa25d7
first pipeline for github workflow
james-jdgtl c246e85
add commented out branches to run on every push
james-jdgtl b64313d
end to end flow for build and deploy - first attempt
james-jdgtl 8cd8cd0
full validation deployment
james-jdgtl b92ca90
try running the pipeline
james-jdgtl baef14b
refactor the workflow a bit
james-jdgtl fcfc2a2
change pipeline name
james-jdgtl bcbfa04
use the correct registry
james-jdgtl adcbcdd
remove deployment gate
james-jdgtl e34a1ae
use create app version in action
james-jdgtl 2e339a0
bump
james-jdgtl b9698a1
bump to main
james-jdgtl f7ad579
only run on main branch
james-jdgtl a641c07
Bump workflow version to v1.0
james-jdgtl 333fc22
remove CircleCI references
james-jdgtl 3b06c00
pin to major version
james-jdgtl 9604968
make pipeline name match the other template
james-jdgtl 16b6081
update documentation to reference Github Actions bits
james-jdgtl 8ad5dd8
run on all branches but only build (and deploy) on main
james-jdgtl 13c6147
SDIT-2049: ⬆️ Upgrade to hmpps spring boot 6.0.6 for path directory t…
petergphillips abcc65f
Move security jobs from circleci to github actions (#243)
mattops 3220581
end to end flow for build and deploy - first attempt
james-jdgtl d32f9cc
end to end flow for build and deploy - first attempt
james-jdgtl 01fee5b
Merge branch 'main' into HEAT-313-kotlin-github-workflow
james-jdgtl 3b63177
add preprod and prod environments as examples
james-jdgtl a0d39b4
change to Cloud Platform appinsights secret
james-jdgtl 852ccff
Merge branch 'main' into HEAT-313-kotlin-github-workflow
mattops File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
mattops marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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' | ||
mattops marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- '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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if on a workflow dispatch we need all these options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed the process for CircleCI and it carries out the workflow for all branches, but only builds and deploys on main. I've updated this PR to reflect that.