|
1 | 1 | name: "CI/CD: Release" |
2 | 2 |
|
3 | | -# Triggered by pushing a v* tag (e.g. git tag v1.2.3 && git push origin v1.2.3). |
4 | | -# Builds the release artifact then deploys infra + software through each |
5 | | -# environment in sequence, running a smoke test before promoting to the next. |
6 | | -# |
7 | 3 | # Prod requires a manual approval — configure required reviewers in GitHub |
8 | 4 | # Settings → Environments → prod before provisioning the prod environment. |
9 | 5 |
|
@@ -38,152 +34,41 @@ jobs: |
38 | 34 | new_release_published: true |
39 | 35 | secrets: inherit |
40 | 36 |
|
41 | | - # ---- dev ------------------------------------------------------------------ |
42 | | - |
43 | | - deploy-infra-dev: |
44 | | - name: Deploy infra (dev) |
| 37 | + deploy-dev: |
| 38 | + name: Deploy (dev) |
45 | 39 | needs: build-stage |
46 | | - permissions: |
47 | | - id-token: write |
48 | | - uses: ./.github/workflows/stage-4-deploy.yaml |
49 | | - with: |
50 | | - environments: '["dev"]' |
51 | | - commit_sha: ${{ github.sha }} |
52 | | - secrets: inherit |
53 | | - |
54 | | - deploy-app-dev: |
55 | | - name: Deploy app (dev) |
56 | | - needs: deploy-infra-dev |
57 | | - permissions: |
58 | | - id-token: write |
59 | | - uses: ./.github/workflows/stage-4-deploy-app.yaml |
| 40 | + uses: ./.github/workflows/stage-4-deploy-env.yaml |
60 | 41 | with: |
61 | | - environments: '["dev"]' |
| 42 | + environment: dev |
62 | 43 | release_tag: ${{ github.ref_name }} |
63 | 44 | commit_sha: ${{ github.sha }} |
64 | 45 | secrets: inherit |
65 | 46 |
|
66 | | - smoke-test-dev: |
67 | | - name: Smoke test (dev) |
68 | | - needs: deploy-app-dev |
69 | | - runs-on: ubuntu-latest |
70 | | - environment: dev |
71 | | - permissions: |
72 | | - id-token: write |
73 | | - steps: |
74 | | - - name: Checkout code |
75 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
76 | | - |
77 | | - - name: Azure login |
78 | | - uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 |
79 | | - with: |
80 | | - client-id: ${{ secrets.AZURE_CLIENT_ID }} |
81 | | - tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
82 | | - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
83 | | - |
84 | | - - name: Run smoke test |
85 | | - run: bash scripts/bash/smoke_test.sh dev |
86 | | - |
87 | | - # ---- preprod -------------------------------------------------------------- |
88 | | - |
89 | | - deploy-infra-preprod: |
90 | | - name: Deploy infra (preprod) |
91 | | - needs: smoke-test-dev |
92 | | - permissions: |
93 | | - id-token: write |
94 | | - uses: ./.github/workflows/stage-4-deploy.yaml |
95 | | - with: |
96 | | - environments: '["preprod"]' |
97 | | - commit_sha: ${{ github.sha }} |
98 | | - secrets: inherit |
99 | | - |
100 | | - deploy-app-preprod: |
101 | | - name: Deploy app (preprod) |
102 | | - needs: deploy-infra-preprod |
103 | | - permissions: |
104 | | - id-token: write |
105 | | - uses: ./.github/workflows/stage-4-deploy-app.yaml |
| 47 | + deploy-preprod: |
| 48 | + name: Deploy (preprod) |
| 49 | + needs: deploy-dev |
| 50 | + uses: ./.github/workflows/stage-4-deploy-env.yaml |
106 | 51 | with: |
107 | | - environments: '["preprod"]' |
| 52 | + environment: preprod |
108 | 53 | release_tag: ${{ github.ref_name }} |
109 | 54 | commit_sha: ${{ github.sha }} |
110 | 55 | secrets: inherit |
111 | 56 |
|
112 | | - smoke-test-preprod: |
113 | | - name: Smoke test (preprod) |
114 | | - needs: deploy-app-preprod |
115 | | - runs-on: ubuntu-latest |
116 | | - environment: preprod |
117 | | - permissions: |
118 | | - id-token: write |
119 | | - steps: |
120 | | - - name: Checkout code |
121 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
122 | | - |
123 | | - - name: Azure login |
124 | | - uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 |
125 | | - with: |
126 | | - client-id: ${{ secrets.AZURE_CLIENT_ID }} |
127 | | - tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
128 | | - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
129 | | - |
130 | | - - name: Run smoke test |
131 | | - run: bash scripts/bash/smoke_test.sh preprod |
132 | | - |
133 | | - # ---- prod ----------------------------------------------------------------- |
134 | | - # Requires the 'prod' GitHub Environment to be configured with required |
135 | | - # reviewers (Settings → Environments → prod → Required reviewers). |
136 | | - # Jobs will be added once the prod Azure environment is provisioned. |
137 | | - |
138 | 57 | prod-approval: |
139 | 58 | name: Awaiting prod approval |
140 | | - needs: smoke-test-preprod |
| 59 | + needs: deploy-preprod |
141 | 60 | runs-on: ubuntu-latest |
142 | 61 | environment: prod |
143 | 62 | steps: |
144 | 63 | - name: Approved |
145 | | - run: echo "Prod deployment approved — proceeding" |
| 64 | + run: echo "Prod deployment approved - proceeding" |
146 | 65 |
|
147 | | - deploy-infra-prod: |
148 | | - name: Deploy infra (prod) |
| 66 | + deploy-prod: |
| 67 | + name: Deploy (prod) |
149 | 68 | needs: prod-approval |
150 | | - permissions: |
151 | | - id-token: write |
152 | | - uses: ./.github/workflows/stage-4-deploy.yaml |
| 69 | + uses: ./.github/workflows/stage-4-deploy-env.yaml |
153 | 70 | with: |
154 | | - environments: '["prod"]' |
155 | | - commit_sha: ${{ github.sha }} |
156 | | - secrets: inherit |
157 | | - |
158 | | - deploy-app-prod: |
159 | | - name: Deploy app (prod) |
160 | | - needs: deploy-infra-prod |
161 | | - permissions: |
162 | | - id-token: write |
163 | | - uses: ./.github/workflows/stage-4-deploy-app.yaml |
164 | | - with: |
165 | | - environments: '["prod"]' |
| 71 | + environment: prod |
166 | 72 | release_tag: ${{ github.ref_name }} |
167 | 73 | commit_sha: ${{ github.sha }} |
168 | 74 | secrets: inherit |
169 | | - |
170 | | - smoke-test-prod: |
171 | | - name: Smoke test (prod) |
172 | | - needs: deploy-app-prod |
173 | | - runs-on: ubuntu-latest |
174 | | - environment: prod |
175 | | - permissions: |
176 | | - id-token: write |
177 | | - steps: |
178 | | - - name: Checkout code |
179 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
180 | | - |
181 | | - - name: Azure login |
182 | | - uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 |
183 | | - with: |
184 | | - client-id: ${{ secrets.AZURE_CLIENT_ID }} |
185 | | - tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
186 | | - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
187 | | - |
188 | | - - name: Run smoke test |
189 | | - run: bash scripts/bash/smoke_test.sh prod |
0 commit comments