52
52
with :
53
53
files : |
54
54
terraform/**
55
+ - name : get changed docs files in any folder
56
+ id : changed-files-docs
57
+ uses : tj-actions/changed-files@1864dc5311069c2319e40ddda20ebf24336dcba9
58
+ with :
59
+ files : |
60
+ **/*.md
55
61
- name : extract variables for workflow
56
62
id : variables
57
63
run : |
63
69
elif [[ ${{ steps.changed-files-admin.outputs.only_changed }} = "true" ]]
64
70
then
65
71
echo "path=$(echo admin)" >> $GITHUB_OUTPUT
72
+ elif [[ ${{ steps.changed-files-docs.outputs.only_changed }} = "true" ]]
73
+ then
74
+ echo "path=$(echo docs)" >> $GITHUB_OUTPUT
66
75
else
67
76
echo "path=$(echo all)" >> $GITHUB_OUTPUT
68
77
fi
72
81
run : |
73
82
echo "path chosen - $SPECIFIC_PATH"
74
83
84
+ update_documentation :
85
+ name : update documentation
86
+ runs-on : ubuntu-latest
87
+ needs :
88
+ - workflow_variables
89
+ steps :
90
+ - name : only update documentation
91
+ run : echo 'Only docs have changed - skipping rest of pipeline'
92
+ if : |
93
+ needs.workflow_variables.outputs.specific_path == 'docs'
94
+
75
95
terraform_lint :
76
96
name : lint terraform code
77
97
uses : ./.github/workflows/_lint-terraform.yml
83
103
secrets : inherit
84
104
if : |
85
105
always() &&
86
- needs.workflow_variables.result == 'success'
106
+ needs.workflow_variables.result == 'success' &&
107
+ needs.workflow_variables.outputs.specific_path != 'docs'
87
108
88
109
node_test :
89
110
name : test node dependencies
@@ -176,7 +197,7 @@ jobs:
176
197
needs.workflow_variables.result == 'success'
177
198
178
199
terraform_preproduction_plan_environment :
179
- name : terraform apply environment
200
+ name : terraform plan preproduction environment
180
201
uses : ./.github/workflows/_run-terraform.yml
181
202
needs :
182
203
- docker_build_scan_push
@@ -261,14 +282,21 @@ jobs:
261
282
- slack_notify
262
283
- workflow_variables
263
284
- workspace_name
285
+ - update_documentation
264
286
steps :
265
287
- name : workflow has ended without issue
266
288
run : |
267
- echo "${{ needs.workflow_variables.outputs.parsed_branch }} PR environment tested, built and deployed"
268
- echo "Tag Used: ${{ needs.workflow_variables.outputs.parsed_branch }}-${{ needs.workflow_variables.outputs.short_sha }}"
269
- echo "URL: https://${{ needs.workspace_name.outputs.name }}.use-lasting-power-of-attorney.service.gov.uk"
289
+ if [[ ${{ needs.workflow_variables.outputs.specific_path }} = 'docs' ]]
290
+ then
291
+ echo 'Ending docs workflow'
292
+ else
293
+ echo "${{ needs.workflow_variables.outputs.parsed_branch }} PR environment tested, built and deployed"
294
+ echo "Tag Used: ${{ needs.workflow_variables.outputs.parsed_branch }}-${{ needs.workflow_variables.outputs.short_sha }}"
295
+ echo "URL: https://${{ needs.workspace_name.outputs.name }}.use-lasting-power-of-attorney.service.gov.uk"
296
+ fi
270
297
if : |
271
298
always() &&
272
- needs.ecr_scan_results.result == 'success' &&
273
- needs.slack_notify.result == 'success' &&
274
- needs.workflow_variables.result == 'success'
299
+ ((needs.ecr_scan_results.result == 'success' || needs.ecr_scan_results.result == 'skipped') &&
300
+ (needs.slack_notify.result == 'success' || needs.slack_notify.result == 'skipped') &&
301
+ needs.workflow_variables.result == 'success') ||
302
+ needs.update_documentation.result == 'success'
0 commit comments