Skip to content

Commit

Permalink
Updates - added matrix to helm lint, and new workflow for deploying a…
Browse files Browse the repository at this point in the history
… specific version to an environment.
  • Loading branch information
mattops committed Nov 7, 2024
1 parent 862c3d9 commit 65aa535
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 42 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@v1 # 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@v1 # WORKFLOW_VERSION
secrets: inherit
with:
environment: ${{ inputs.environment }}
app_version: ${{ inputs.version }}
52 changes: 10 additions & 42 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,15 @@ on:
- '**'
workflow_dispatch:
inputs:
environment:
description: Environment
type: choice
required: true
options:
- dev
- preprod
- staging
- prod
default: 'dev'
version: # Only used when run manually - build.yml will include it - bump
description: Image version
type: string
required: true
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 @@ -75,11 +40,14 @@ jobs:
needs: [node_build]
secrets: inherit
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 }}
build:
name: Build docker image from hmpps-github-actions
if: github.ref == 'refs/heads/main'
Expand All @@ -88,11 +56,11 @@ jobs:
- node_integration_tests
- node_unit_tests
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 || false }}
docker_multiplatform: true
deploy_dev:
name: Deploy to the development environment
needs:
Expand All @@ -102,7 +70,7 @@ jobs:
secrets: inherit
with:
environment: 'dev'
app_version: '${{ needs.build.outputs.app_version }}'
app_version: '${{ needs.build.outputs.app_version }} }}'
# deploy_preprod:
# name: Deploy to pre-production environment
# needs:
Expand Down

0 comments on commit 65aa535

Please sign in to comment.