Skip to content

Commit d83068b

Browse files
Merge pull request #162 from NHSDigital/aiva2/CCM-7407_AddingDedicatedJobsPerMicroserviceg
CCM-7407 target new dedicated jobs for builds
2 parents 59cd816 + a1fb527 commit d83068b

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

.github/workflows/pr_merge.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ jobs:
2222
strategy:
2323
max-parallel: 1
2424
matrix:
25-
component: [dnsroot]
25+
component: [acct, app]
2626

27-
uses: ./.github/workflows/trigger_internal_repo_build.yaml
27+
uses: ./.github/workflows/reusable_internal_repo_build.yaml
2828
secrets: inherit
2929
with:
3030
release_version: main
31+
target_workflow: "dispatch-deploy-static-notify-web-template-management-env.yaml"
3132
tf_environment: "main"
3233
tf_group: "nhs-notify-template-management-dev"
3334
tf_component: ${{ matrix.component }}

.github/workflows/release_created.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ concurrency:
1111
jobs:
1212
deploy-main:
1313
name: Deploy changes to main in nonprod AWS Account
14-
runs-on: ubuntu-latest
14+
15+
permissions:
16+
id-token: write
17+
contents: read
1518

1619
strategy:
1720
max-parallel: 1
1821
matrix:
19-
component: [dnsroot]
22+
component: [acct, app]
2023

21-
steps:
22-
- name: Trigger nhs-notify-internal static environment workflow deployments
23-
uses: ./.github/workflows/trigger_internal_repo_build.yaml
24-
with:
25-
secrets: inherit
26-
release_version: ${{ github.event.release.tag_name }}
27-
tf_environment: "main"
28-
tf_group: "nhs-notify-template-management-nonprod"
29-
tf_component: ${{ matrix.component }}
30-
tf_action: "apply"
24+
uses: ./.github/workflows/reusable_internal_repo_build.yaml
25+
secrets: inherit
26+
with:
27+
release_version: ${{ github.event.release.tag_name }}
28+
target_workflow: "dispatch-deploy-static-notify-web-template-management-env.yaml"
29+
tf_environment: "main"
30+
tf_group: "nhs-notify-template-management-nonprod"
31+
tf_component: ${{ matrix.component }}
32+
tf_action: "apply"

.github/workflows/trigger_internal_repo_build.yaml renamed to .github/workflows/reusable_internal_repo_build.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Trigger Notify Internal Infrastructure Deployment
1+
name: Call Notify Internal Infrastructure Deployment
22
## Sub workflow which plans and deploys Notify components as part of the workflow.
33
## Review Gates may be required to proceed on triggered builds.
44

@@ -9,6 +9,10 @@ on:
99
type: string
1010
description: The Github release version, commit, or tag.
1111
default: main
12+
target_workflow:
13+
type: string
14+
description: The name of the github workflow to call.
15+
default: main
1216
tf_environment:
1317
type: string
1418
description: The Terraform environment to deploy
@@ -44,18 +48,15 @@ jobs:
4448
shell: bash
4549
run: |
4650
set -x
47-
this_repo_name=$(echo ${{ github.repository }} | cut -d'/' -f2)
4851
4952
DISPATCH_EVENT=$(jq -ncM \
50-
--arg infraRepoName "${this_repo_name}" \
5153
--arg releaseVersion ${{ inputs.release_version }} \
5254
--arg targetEnvironment ${{ inputs.tf_environment }} \
5355
--arg targetAccountGroup ${{ inputs.tf_group }} \
5456
--arg targetComponent ${{ inputs.tf_component }} \
5557
--arg terraformAction ${{ inputs.tf_action }} \
5658
'{ "ref": "main",
5759
"inputs": {
58-
"infraRepoName": $infraRepoName,
5960
"releaseVersion", $releaseVersion,
6061
"targetEnvironment", $targetEnvironment,
6162
"targetAccountGroup", $targetAccountGroup,
@@ -72,7 +73,7 @@ jobs:
7273
-H "Accept: application/vnd.github+json" \
7374
-H "Authorization: Bearer ${{ secrets.PR_TRIGGER_PAT }}" \
7475
-H "X-GitHub-Api-Version: 2022-11-28" \
75-
https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/dispatch-deploy-static-env.yaml/dispatches \
76+
"https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/${{ inputs.target_workflow }}/dispatches" \
7677
-d "${DISPATCH_EVENT}"
7778
7879
echo "Workflow triggered successfully. HTTP response. Waiting for the workflow to complete.."

0 commit comments

Comments
 (0)