Skip to content

Commit a55f8f9

Browse files
CCM-11971: Move PR Created Workflow before Acceptance Tests
1 parent 3369ac2 commit a55f8f9

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

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

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -120,31 +120,9 @@ jobs:
120120
version: "${{ needs.metadata.outputs.version }}"
121121
pr_number: "${{ needs.metadata.outputs.pr_number }}"
122122
secrets: inherit
123-
pr-create-dynamic-environment:
124-
name: Create Dynamic Environment
125-
runs-on: ubuntu-latest
126-
needs: [metadata, build-stage]
127-
steps:
128-
- uses: actions/checkout@v5
129-
- name: Trigger dynamic environment creation
130-
env:
131-
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
132-
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
133-
shell: bash
134-
run: |
135-
.github/scripts/dispatch_internal_repo_workflow.sh \
136-
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
137-
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
138-
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
139-
--targetEnvironment "pr${{ github.event.number }}" \
140-
--targetComponent "api" \
141-
--targetAccountGroup "nhs-notify-supplier-api-dev" \
142-
--terraformAction "apply" \
143-
--overrideProjectName "nhs" \
144-
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
145123
acceptance-stage: # Recommended maximum execution time is 10 minutes
146124
name: "Acceptance stage"
147-
needs: [metadata, build-stage, pr-create-dynamic-environment]
125+
needs: [metadata, build-stage]
148126
uses: ./.github/workflows/stage-4-acceptance.yaml
149127
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')) || (github.event_name == 'push' && github.ref == 'refs/heads/main')
150128
with:

.github/workflows/stage-3-build.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,31 @@ jobs:
8787
# uses: ./.github/actions/build-libraries
8888
# with:
8989
# version: "${{ inputs.version }}"
90-
90+
pr-create-dynamic-environment:
91+
name: Create Dynamic Environment
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v5
95+
- name: Trigger dynamic environment creation
96+
env:
97+
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
98+
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
99+
shell: bash
100+
run: |
101+
.github/scripts/dispatch_internal_repo_workflow.sh \
102+
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
103+
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
104+
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
105+
--targetEnvironment "pr${{ github.event.number }}" \
106+
--targetComponent "api" \
107+
--targetAccountGroup "nhs-notify-supplier-api-dev" \
108+
--terraformAction "apply" \
109+
--overrideProjectName "nhs" \
110+
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
91111
artefact-proxies:
92112
name: "Build proxies"
93113
runs-on: ubuntu-latest
114+
needs: [pr-create-dynamic-environment]
94115
timeout-minutes: 10
95116
env:
96117
PROXYGEN_API_NAME: nhs-notify-supplier

0 commit comments

Comments
 (0)