Skip to content

Commit d606fb0

Browse files
CCM-11971: Move PR Created Workflow before Acceptance Tests
1 parent 91152c4 commit d606fb0

File tree

2 files changed

+21
-36
lines changed

2 files changed

+21
-36
lines changed

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,29 @@ jobs:
121121
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
122122
version: "${{ needs.metadata.outputs.version }}"
123123
secrets: inherit
124+
pr-create-dynamic-environment:
125+
name: Create Dynamic Environment
126+
runs-on: ubuntu-latest
127+
steps:
128+
- uses: actions/[email protected]
129+
- name: Trigger dynamic environment creation
130+
env:
131+
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
132+
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
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 "branch" \
141+
--targetAccountGroup "nhs-notify-template-management-dev" \
142+
--terraformAction "apply" \
143+
--overrides "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
124144
acceptance-stage: # Recommended maximum execution time is 10 minutes
125145
name: "Acceptance stage"
126-
needs: [metadata, dependencies, test-stage]
146+
needs: [metadata, dependencies, test-stage, pr-create-dynamic-environment]
127147
uses: ./.github/workflows/stage-4-acceptance.yaml
128148
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')
129149
secrets: inherit

.github/workflows/pr_create_dynamic_env.yaml

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

0 commit comments

Comments
 (0)