Skip to content

Commit

Permalink
Merge branch 'main' into HEAT-417-cancel-existing-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
james-jdgtl authored Dec 17, 2024
2 parents ce2a1b9 + aebc308 commit 99d6aed
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 43 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy_to_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to environment

on:
workflow_dispatch:
inputs:
environment:
description: Environment
type: choice
required: true
options:
- dev
- preprod
- prod
default: 'dev'
version:
description: version to be deployed to the environment - must already exist.
required: true
default: ''
type: string

permissions:
contents: read

jobs:
helm_lint:
name: helm lint
uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v2 # WORKFLOW_VERSION
secrets: inherit
with:
environment: ${{ inputs.environment }}
deploy_env:
name: Deploy to environment
needs:
- helm_lint
uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 # WORKFLOW_VERSION
secrets: inherit
with:
environment: ${{ inputs.environment }}
app_version: ${{ inputs.version }}
56 changes: 13 additions & 43 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,17 @@ 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
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: true
type: boolean
docker_multiplatform:
description: docker multiplatform build or not
required: true
default: true
default: false
type: boolean

permissions:
Expand All @@ -61,11 +29,14 @@ concurrency:

jobs:
helm_lint:
strategy:
matrix:
environments: ['dev', 'preprod', 'prod']
name: helm lint
uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v1 # WORKFLOW VERSION
secrets: inherit
with:
environment: ${{ inputs.environment || 'dev' }}
environment: ${{ matrix.environments }}
kotlin_validate:
name: Validate the kotlin
uses: ministryofjustice/hmpps-github-actions/.github/workflows/kotlin_validate.yml@v2 # WORKFLOW_VERSION
Expand All @@ -77,25 +48,24 @@ jobs:
needs:
- kotlin_validate
with:
docker_registry: ${{ inputs.docker_registry || 'ghcr.io' }}
registry_org: ${{ inputs.registry_org || 'ministryofjustice' }}
docker_registry: 'ghcr.io'
registry_org: 'ministryofjustice'
additional_docker_tag: ${{ inputs.additional_docker_tag }}
push: ${{ inputs.push || true }}
docker_multiplatform: ${{ inputs.docker_multiplatform || true }}
docker_multiplatform: true
deploy_dev:
name: Deploy to dev environment
needs:
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:
# needs:
# - build
# - deploy_dev
# uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 # WORKFLOW_VERSION
Expand All @@ -105,7 +75,7 @@ jobs:
# app_version: '${{ needs.build.outputs.app_version }}'
# deploy_prod:
# name: Deploy to production environment
# needs:
# needs:
# - build
# - deploy_preprod
# uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2 # WORKFLOW_VERSION
Expand Down

0 comments on commit 99d6aed

Please sign in to comment.