Skip to content

Commit e03e1cf

Browse files
committed
Merge remote-tracking branch 'origin/main' into dependabot/github_actions/NHSDigital/eps-workflow-quality-checks-4.0.4
2 parents b18bd53 + 76b71d5 commit e03e1cf

File tree

14 files changed

+444
-421
lines changed

14 files changed

+444
-421
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Create confluence release notes"
2+
description: "Do release note actions in confluence and jira"
3+
inputs:
4+
RELEASE_TAG:
5+
required: false
6+
description: "The tag we are marking as released in jira"
7+
DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE:
8+
required: true
9+
description: "The role to assume to execute the release notes lambda"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: connect to dev account
15+
uses: aws-actions/configure-aws-credentials@v4
16+
with:
17+
aws-region: eu-west-2
18+
role-to-assume: ${{ inputs.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }}
19+
role-session-name: vpc-resources-release-notes-run-lambda
20+
21+
- name: call markJiraReleased lambda
22+
shell: bash
23+
working-directory: .github/scripts
24+
env:
25+
RELEASE_TAG: ${{ inputs.RELEASE_TAG }}
26+
run: ./call_mark_jira_released.sh
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: "Create confluence release notes"
2+
description: "Do release note actions in confluence and jira"
3+
inputs:
4+
TARGET_ENVIRONMENT:
5+
required: true
6+
description: "Target Environment"
7+
RELEASE_TAG:
8+
required: false
9+
description: "The tag we are releasing - only used for create_rc_release_notes"
10+
CONFLUENCE_PAGE_ID:
11+
required: true
12+
description: "The id of confluence page to update or create under"
13+
CREATE_RC_RELEASE_NOTES:
14+
required: true
15+
description: "whether to create rc release notes page instead of normal release notes"
16+
default: "false"
17+
DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE:
18+
required: true
19+
description: "The role to assume to execute the release notes lambda"
20+
DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE:
21+
required: true
22+
description: "The dev cloud formation deploy role"
23+
TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE:
24+
required: true
25+
description: "The target cloud formation deploy role"
26+
27+
runs:
28+
using: "composite"
29+
steps:
30+
- name: connect to target account
31+
uses: aws-actions/configure-aws-credentials@v4
32+
with:
33+
aws-region: eu-west-2
34+
role-to-assume: ${{ inputs.TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
35+
role-session-name: vpc-resources-release-notes-target
36+
37+
- name: Get deployed tag on target
38+
shell: bash
39+
working-directory: .github/scripts
40+
env:
41+
TARGET_ENVIRONMENT: ${{ inputs.TARGET_ENVIRONMENT }}
42+
run: ./get_target_deployed_tag.sh
43+
44+
- name: connect to dev account
45+
uses: aws-actions/configure-aws-credentials@v4
46+
with:
47+
aws-region: eu-west-2
48+
role-to-assume: ${{ inputs.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
49+
role-session-name: vpc-resources-release-notes-dev
50+
51+
- name: get current dev tag
52+
shell: bash
53+
working-directory: .github/scripts
54+
run: ./get_current_dev_tag.sh
55+
56+
- name: connect to dev account to run release notes lambda
57+
uses: aws-actions/configure-aws-credentials@v4
58+
with:
59+
aws-region: eu-west-2
60+
role-to-assume: ${{ inputs.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }}
61+
role-session-name: vpc-resources-release-notes-run-lambda
62+
unset-current-credentials: true
63+
64+
- name: create int release notes
65+
shell: bash
66+
working-directory: .github/scripts
67+
if: inputs.TARGET_ENVIRONMENT == 'int' && inputs.CREATE_RC_RELEASE_NOTES == 'false'
68+
env:
69+
ENV: INT
70+
PAGE_ID: ${{ inputs.CONFLUENCE_PAGE_ID }}
71+
run: ./create_env_release_notes.sh
72+
73+
- name: create int rc release notes
74+
shell: bash
75+
working-directory: .github/scripts
76+
if: inputs.TARGET_ENVIRONMENT == 'int' && inputs.CREATE_RC_RELEASE_NOTES == 'true'
77+
env:
78+
RELEASE_TAG: ${{ inputs.RELEASE_TAG }}
79+
PAGE_ID: ${{ inputs.CONFLUENCE_PAGE_ID }}
80+
run: ./create_int_rc_release_notes.sh
81+
82+
- name: create prod release notes
83+
shell: bash
84+
working-directory: .github/scripts
85+
if: inputs.TARGET_ENVIRONMENT == 'prod'
86+
env:
87+
ENV: PROD
88+
PAGE_ID: ${{ inputs.CONFLUENCE_PAGE_ID }}
89+
run: ./create_env_release_notes.sh

.github/workflows/cdk_release_code.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
LOG_RETENTION_IN_DAYS:
1616
required: true
1717
type: string
18+
DEPLOY_CHANGE:
19+
type: boolean
20+
default: true
1821
secrets:
1922
CLOUD_FORMATION_DEPLOY_ROLE:
2023
required: true
@@ -107,6 +110,7 @@ jobs:
107110
shell: bash
108111

109112
- name: Deploy code
113+
if: ${{ inputs.DEPLOY_CHANGE == true}}
110114
run: |
111115
docker run \
112116
-v "$(pwd)/.build":/home/cdkuser/workspace/ \

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
103103
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
104104
LOG_RETENTION_IN_DAYS: 30
105+
DEPLOY_CHANGE: true
105106
secrets:
106107
CDK_PULL_IMAGE_ROLE: ${{ secrets.DEV_CDK_PULL_IMAGE_ROLE }}
107108
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
@@ -130,6 +131,7 @@ jobs:
130131
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
131132
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
132133
LOG_RETENTION_IN_DAYS: 30
134+
DEPLOY_CHANGE: true
133135
secrets:
134136
CDK_PULL_IMAGE_ROLE: ${{ secrets.QA_CDK_PULL_IMAGE_ROLE }}
135137
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.QA_CLOUD_FORMATION_DEPLOY_ROLE }}

.github/workflows/pull_request.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,22 @@ jobs:
5252
run: |
5353
echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
5454
55+
package_code:
56+
needs: [quality_checks, get_issue_number, get_commit_id]
57+
uses: ./.github/workflows/cdk_package_code.yml
58+
with:
59+
VERSION_NUMBER: ${{needs.get_issue_number.outputs.issue_number}}
60+
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
61+
62+
show_dev_changes:
63+
needs: [quality_checks, get_issue_number, package_code, get_commit_id]
64+
uses: ./.github/workflows/cdk_release_code.yml
65+
with:
66+
TARGET_ENVIRONMENT: dev
67+
VERSION_NUMBER: ${{needs.get_issue_number.outputs.issue_number}}
68+
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
69+
LOG_RETENTION_IN_DAYS: 30
70+
DEPLOY_CHANGE: false
71+
secrets:
72+
CDK_PULL_IMAGE_ROLE: ${{ secrets.DEV_CDK_PULL_IMAGE_ROLE }}
73+
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ jobs:
121121
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
122122
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
123123
LOG_RETENTION_IN_DAYS: 30
124+
DEPLOY_CHANGE: true
124125
secrets:
125126
CDK_PULL_IMAGE_ROLE: ${{ secrets.DEV_CDK_PULL_IMAGE_ROLE }}
126127
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
@@ -148,6 +149,7 @@ jobs:
148149
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
149150
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
150151
LOG_RETENTION_IN_DAYS: 30
152+
DEPLOY_CHANGE: true
151153
secrets:
152154
CDK_PULL_IMAGE_ROLE: ${{ secrets.REF_CDK_PULL_IMAGE_ROLE }}
153155
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.REF_CLOUD_FORMATION_DEPLOY_ROLE }}
@@ -160,6 +162,7 @@ jobs:
160162
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
161163
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
162164
LOG_RETENTION_IN_DAYS: 30
165+
DEPLOY_CHANGE: true
163166
secrets:
164167
CDK_PULL_IMAGE_ROLE: ${{ secrets.QA_CDK_PULL_IMAGE_ROLE }}
165168
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.QA_CLOUD_FORMATION_DEPLOY_ROLE }}
@@ -172,6 +175,7 @@ jobs:
172175
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
173176
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
174177
LOG_RETENTION_IN_DAYS: 30
178+
DEPLOY_CHANGE: true
175179
secrets:
176180
CDK_PULL_IMAGE_ROLE: ${{ secrets.INT_CDK_PULL_IMAGE_ROLE }}
177181
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.INT_CLOUD_FORMATION_DEPLOY_ROLE }}
@@ -184,6 +188,7 @@ jobs:
184188
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
185189
COMMIT_ID: ${{needs.get_commit_id.outputs.commit_id}}
186190
LOG_RETENTION_IN_DAYS: 30
191+
DEPLOY_CHANGE: true
187192
secrets:
188193
CDK_PULL_IMAGE_ROLE: ${{ secrets.PROD_CDK_PULL_IMAGE_ROLE }}
189194
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.PROD_CLOUD_FORMATION_DEPLOY_ROLE }}

0 commit comments

Comments
 (0)