-
Notifications
You must be signed in to change notification settings - Fork 2
105 lines (92 loc) · 2.69 KB
/
pipeline_main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Main
on:
push:
branches:
- main
permissions:
contents: read
packages: write
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
node_build:
name: node build
uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build.yml@v2
secrets: inherit
node_unit_tests:
name: node unit tests
uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_unit_tests.yml@v2
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@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
e2e_test:
needs: build_docker
uses: ./.github/workflows/e2e_test.yml
with:
app_version: ${{ needs.build_docker.outputs.app_version }}
publish_docker:
name: Publish docker image
needs:
- node_build
- node_unit_tests
- build_docker
- e2e_test
- 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 }}'