Skip to content

Commit 3369ac2

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

File tree

3 files changed

+24
-39
lines changed

3 files changed

+24
-39
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,31 @@ 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"
123145
acceptance-stage: # Recommended maximum execution time is 10 minutes
124146
name: "Acceptance stage"
125-
needs: [metadata, build-stage]
147+
needs: [metadata, build-stage, pr-create-dynamic-environment]
126148
uses: ./.github/workflows/stage-4-acceptance.yaml
127149
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')
128150
with:

.github/workflows/pr_create_dynamic_env.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ gitleaks 8.24.0
33
jq 1.6
44
nodejs 22.15.0
55
pre-commit 3.6.0
6-
python 3.12.11
6+
python 3.13.2
77
terraform 1.10.1
88
terraform-docs 0.19.0
99
trivy 0.61.0

0 commit comments

Comments
 (0)