Skip to content
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

ARN-2494 Switch to GitHub Actions #345

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 0 additions & 169 deletions .circleci/config.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
* @ministryofjustice/hmpps-assessments
24 changes: 24 additions & 0 deletions .github/workflows/deploy_to_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy to environment

on:
workflow_dispatch:
inputs:
environment:
description: Environment
type: choice
required: true
options:
- dev
default: 'dev'
image_tag:
description: Optional image tag to deploy. If left blank, a new image will be built, pushed and deployed
required: false
default: ''
type: string

jobs:
deploy_to_env:
uses: ministryofjustice/hmpps-assess-risks-and-needs-github-actions/.github/workflows/deploy_to_env.yml@v1
with:
environment: ${{ inputs.environment }}
image_tag: ${{ inputs.image_tag }}
88 changes: 88 additions & 0 deletions .github/workflows/pipeline_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Main

on:
push:
branches:
- main

permissions:
contents: read
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:

validate:
uses: ./.github/workflows/validate.yml

helm_lint:
name: Helm lint
strategy:
matrix:
environments: [ 'dev', 'preprod', 'prod' ]
uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v2
secrets: inherit
with:
environment: ${{ matrix.environments }}

build_docker:
name: Build docker image
uses: ministryofjustice/hmpps-github-actions/.github/workflows/docker_build.yml@v2
with:
docker_registry: 'ghcr.io'
registry_org: 'ministryofjustice'
tag_latest: false
push: false
load: true
docker_multiplatform: false
upload_image_artifact: true
image_artifact_retention_days: 2

publish_docker:
name: Publish docker image
needs:
- validate
- build_docker
- helm_lint
uses: ministryofjustice/hmpps-github-actions/.github/workflows/docker_push.yml@v2
with:
docker_registry: 'ghcr.io'
registry_org: 'ministryofjustice'
app_version: ${{ needs.build_docker.outputs.app_version }}
tag_latest: true

deploy_dev:
name: Deploy to the development environment
needs:
- build_docker
- publish_docker
uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2
secrets: inherit
with:
environment: 'dev'
app_version: '${{ needs.build_docker.outputs.app_version }}'

deploy_preprod:
name: Deploy to the preproduction environment
needs:
- build_docker
- deploy_dev
uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2
secrets: inherit
with:
environment: 'preprod'
app_version: '${{ needs.build_docker.outputs.app_version }}'

deploy_prod:
name: Deploy to the production environment
needs:
- build_docker
- deploy_preprod
uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v2
secrets: inherit
with:
environment: 'prod'
app_version: '${{ needs.build_docker.outputs.app_version }}'
35 changes: 35 additions & 0 deletions .github/workflows/pipeline_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PR

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
validate:
uses: ./.github/workflows/validate.yml

helm_lint:
name: Helm lint
strategy:
matrix:
environments: ['dev', 'preprod', 'prod']
uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v2
secrets: inherit
with:
environment: ${{ matrix.environments }}

build_docker:
name: Build docker image
uses: ministryofjustice/hmpps-github-actions/.github/workflows/docker_build.yml@v2
with:
docker_registry: 'ghcr.io'
registry_org: 'ministryofjustice'
tag_latest: false
push: false
load: true
docker_multiplatform: false
upload_image_artifact: true
image_artifact_retention_days: 2
12 changes: 12 additions & 0 deletions .github/workflows/security_owasp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security OWASP dependency check
on:
workflow_dispatch:
schedule:
- cron: "51 3 * * MON-FRI" # Every weekday at 03:51 UTC
jobs:
security-owasp-check:
name: Project security OWASP dependency check
uses: ministryofjustice/hmpps-github-actions/.github/workflows/security_owasp.yml@v2 # WORKFLOW_VERSION
with:
channel_id: ${{ vars.SECURITY_ALERTS_SLACK_CHANNEL_ID || 'NO_SLACK' }}
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/security_trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security trivy dependency check
on:
workflow_dispatch:
schedule:
- cron: "51 3 * * MON-FRI" # Every weekday at 03:51 UTC
jobs:
security-trivy-check:
name: Project security trivy dependency check
uses: ministryofjustice/hmpps-github-actions/.github/workflows/security_trivy.yml@v2 # WORKFLOW_VERSION
with:
channel_id: ${{ vars.SECURITY_ALERTS_SLACK_CHANNEL_ID || 'NO_SLACK' }}
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/security_veracode_pipeline_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security veracode pipeline scan
on:
workflow_dispatch:
schedule:
- cron: "51 3 * * MON-FRI" # Every weekday at 03:51 UTC
jobs:
security-veracode-pipeline-scan:
name: Project security veracode pipeline scan
uses: ministryofjustice/hmpps-github-actions/.github/workflows/security_veracode_pipeline_scan.yml@v2 # WORKFLOW_VERSION
with:
channel_id: ${{ vars.SECURITY_ALERTS_SLACK_CHANNEL_ID || 'NO_SLACK' }}
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/security_veracode_policy_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security veracode policy scan
on:
workflow_dispatch:
schedule:
- cron: "4 3 * * 1" # Every Monday at 03:04 UTC
jobs:
security-veracode-policy-check:
name: Project security veracode policy scan
uses: ministryofjustice/hmpps-github-actions/.github/workflows/security_veracode_policy_scan.yml@v2 # WORKFLOW_VERSION
with:
channel_id: ${{ vars.SECURITY_ALERTS_SLACK_CHANNEL_ID || 'NO_SLACK' }}
secrets: inherit
Loading