@@ -12,83 +12,64 @@ jobs:
1212 name : Generate sandbox name
1313 runs-on : ubuntu-latest
1414 outputs :
15- SANDBOX_NAME : ${{ steps.calc-sbx-name .outputs.SANDBOX_NAME }}
16- timeout-minutes : 5
15+ SANDBOX_NAME : ${{ steps.normalize_branch_name .outputs.normalized_branch_name }}
16+ timeout-minutes : 3
1717 steps :
18- - name : Check out the repository
19- uses : actions/checkout@v4
20- - id : calc-sbx-name
21- name : Calculate sandbox name
22- run : |
23- REF=${{ github.ref }}
24- echo "REF=$REF"
25- SANDBOX_NAME=$(./scripts/sandbox-utils.sh "$REF")
26- echo "SANDBOX_NAME=$SANDBOX_NAME"
27- echo "SANDBOX_NAME=$SANDBOX_NAME" >> $GITHUB_OUTPUT
18+ - name : " Get normalized branch name"
19+ id : normalize_branch_name
20+ uses : ./.github/actions/normalize-branch-name
2821
2922
3023 sandbox-set-up :
24+ name : Step 1
25+ needs : generate-sandbox-name
26+ uses : ./.github/workflows/dispatch_internal_repo_workflow.yaml
3127 secrets : inherit
32- steps :
33- - name : " Get normalized branch name"
34- id : normalize_branch_name
35- uses : ./.github/actions/normalize-branch-name
36- - name : Step 1
37- needs : generate-sandbox-name
38- uses : ./.github/workflows/dispatch_internal_repo_workflow.yaml
39- with :
40- jobName : Sandbox set up
41- infraRepoName : nhs-notify-web-template-management
42- releaseVersion : ${{ github.head_ref || github.ref_name }}
43- targetWorkflow : dispatch-deploy-dynamic-env.yaml
44- targetEnvironment : ${{ needs.generate-sandbox-name.outputs.SANDBOX_NAME }}
45- targetAccountGroup : nhs-notify-template-management-dev
46- targetComponent : sandbox
47- terraformAction : apply
28+ with :
29+ jobName : Sandbox set up
30+ infraRepoName : nhs-notify-web-template-management
31+ releaseVersion : ${{ github.head_ref || github.ref_name }}
32+ targetWorkflow : dispatch-deploy-dynamic-env.yaml
33+ targetEnvironment : ${{ needs.generate-sandbox-name.outputs.SANDBOX_NAME }}
34+ targetAccountGroup : nhs-notify-template-management-dev
35+ targetComponent : sandbox
36+ terraformAction : apply
4837
4938 acceptance-tests :
50- secrets : inherit
51- steps :
52- - name : " Get normalized branch name"
53- id : normalize_branch_name
54- uses : ./.github/actions/normalize-branch-name
55- - name : Step 2
56- needs :
57- - sandbox-set-up
58- - generate-sandbox-name
39+ name : Step 2
40+ needs :
41+ - sandbox-set-up
42+ - generate-sandbox-name
5943
60- # Calls out to the nhs-notify-internal repo.
61- # The nhs-notify-internal repo will run the tests
62- # setup in ./.github/actions/acceptance-tests/action.yaml
63- uses : ./.github/workflows/dispatch_internal_repo_workflow.yaml
64- with :
65- jobName : Acceptance tests
66- infraRepoName : nhs-notify-web-template-management
67- releaseVersion : ${{ github.head_ref || github.ref_name }}
68- targetWorkflow : dispatch-contextual-tests-dynamic-env.yaml
69- targetEnvironment : ${{ needs.generate-sandbox-name.outputs.SANDBOX_NAME }}
70- targetAccountGroup : nhs-notify-template-management-dev
71- targetComponent : sandbox
44+ # Calls out to the nhs-notify-internal repo.
45+ # The nhs-notify-internal repo will run the tests
46+ # setup in ./.github/actions/acceptance-tests/action.yaml
47+ uses : ./.github/workflows/dispatch_internal_repo_workflow.yaml
48+ secrets : inherit
49+ with :
50+ jobName : Acceptance tests
51+ infraRepoName : nhs-notify-web-template-management
52+ releaseVersion : ${{ github.head_ref || github.ref_name }}
53+ targetWorkflow : dispatch-contextual-tests-dynamic-env.yaml
54+ targetEnvironment : ${{ needs.generate-sandbox-name.outputs.SANDBOX_NAME }}
55+ targetAccountGroup : nhs-notify-template-management-dev
56+ targetComponent : sandbox
7257
7358 sandbox-tear-down :
74- secrets : inherit
75- steps :
76- - name : " Get normalized branch name"
77- id : normalize_branch_name
78- uses : ./.github/actions/normalize-branch-name
79- - name : Step 3
80- needs :
81- - acceptance-tests
82- - generate-sandbox-name
83- if : always()
59+ name : Step 3
60+ needs :
61+ - acceptance-tests
62+ - generate-sandbox-name
63+ if : always()
8464
85- uses : ./.github/workflows/dispatch_internal_repo_workflow.yaml
86- with :
87- jobName : Sandbox tear down
88- infraRepoName : nhs-notify-web-template-management
89- releaseVersion : ${{ github.head_ref || github.ref_name }}
90- targetWorkflow : dispatch-deploy-dynamic-env.yaml
91- targetEnvironment : ${{ needs.generate-sandbox-name.outputs.SANDBOX_NAME }}
92- targetAccountGroup : nhs-notify-template-management-dev
93- targetComponent : sandbox
94- terraformAction : destroy
65+ uses : ./.github/workflows/dispatch_internal_repo_workflow.yaml
66+ secrets : inherit
67+ with :
68+ jobName : Sandbox tear down
69+ infraRepoName : nhs-notify-web-template-management
70+ releaseVersion : ${{ github.head_ref || github.ref_name }}
71+ targetWorkflow : dispatch-deploy-dynamic-env.yaml
72+ targetEnvironment : ${{ needs.generate-sandbox-name.outputs.SANDBOX_NAME }}
73+ targetAccountGroup : nhs-notify-template-management-dev
74+ targetComponent : sandbox
75+ terraformAction : destroy
0 commit comments