Skip to content

Commit 0f0e396

Browse files
VIA-598 AJ Make workflows readable
1 parent 8931b1e commit 0f0e396

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ env:
1313
AWS_REGION: eu-west-2
1414

1515
jobs:
16+
17+
#################################################
18+
# Set up metadata for the jobs
19+
#################################################
20+
1621
metadata:
1722
name: "Set CI/CD metadata"
1823
runs-on: ubuntu-latest
@@ -69,6 +74,11 @@ jobs:
6974
export VERSION="${{ steps.variables.outputs.version }}"
7075
export DOES_PULL_REQUEST_EXIST="${{ steps.pr_exists.outputs.does_pull_request_exist }}"
7176
make list-variables
77+
78+
#################################################
79+
# Commit stage - static checks
80+
#################################################
81+
7282
commit-stage: # Recommended maximum execution time is 2 minutes
7383
name: "Commit stage"
7484
needs: [ metadata ]
@@ -82,6 +92,11 @@ jobs:
8292
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
8393
version: "${{ needs.metadata.outputs.version }}"
8494
secrets: inherit
95+
96+
#############################################################
97+
# Test stage - unit tests and SonarQube static analysis
98+
#############################################################
99+
85100
test-stage: # Recommended maximum execution time is 5 minutes
86101
name: "Test stage"
87102
needs: [ metadata, commit-stage ]
@@ -95,6 +110,11 @@ jobs:
95110
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
96111
version: "${{ needs.metadata.outputs.version }}"
97112
secrets: inherit
113+
114+
#############################################################
115+
# Build stage - build and upload artefacts
116+
#############################################################
117+
98118
build-stage: # Recommended maximum execution time is 3 minutes
99119
name: "Build stage"
100120
needs: [ metadata, test-stage ]
@@ -109,6 +129,11 @@ jobs:
109129
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
110130
version: "${{ needs.metadata.outputs.version }}"
111131
secrets: inherit
132+
133+
#############################################################
134+
# Deploy stage - download artefacts and deploy to AWS
135+
#############################################################
136+
112137
deploy-stage:
113138
name: "Deploy stage"
114139
needs: [ metadata, build-stage ]
@@ -123,15 +148,6 @@ jobs:
123148
id-token: write
124149
contents: read
125150
steps:
126-
- name: "Tag or SHA"
127-
id: tag-or-sha
128-
run: |
129-
echo "value=${{ github.sha }}" >> $GITHUB_OUTPUT
130-
- name: "Checkout code"
131-
uses: actions/checkout@v6
132-
with:
133-
ref: ${{ github.sha }}
134-
135151
- name: "Deploy ${{ github.sha }} to AWS (dev)"
136152
timeout-minutes: 10
137153
uses: ./.github/actions/deploy
@@ -142,6 +158,10 @@ jobs:
142158
secret_aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
143159
secret_aws_slack_channel_id: ${{ secrets.ALARMS_SLACK_CHANNEL_ID }}
144160

161+
#############################################################
162+
# Acceptance stage - E2E and contract tests
163+
#############################################################
164+
145165
acceptance-stage: # Recommended maximum execution time is 10 minutes
146166
name: "Acceptance stage"
147167
needs: [ metadata, deploy-stage ]

0 commit comments

Comments
 (0)