Skip to content

Commit ea0ef95

Browse files
Feature/ccm 11971 move pr created workflow (#769)
1 parent 91152c4 commit ea0ef95

File tree

2 files changed

+24
-36
lines changed

2 files changed

+24
-36
lines changed

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
109109
version: "${{ needs.metadata.outputs.version }}"
110110
secrets: inherit
111+
111112
test-stage: # Recommended maximum execution time is 5 minutes
112113
name: "Test stage"
113114
needs: [metadata, dependencies, commit-stage]
@@ -121,9 +122,31 @@ jobs:
121122
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
122123
version: "${{ needs.metadata.outputs.version }}"
123124
secrets: inherit
125+
126+
pr-create-dynamic-environment:
127+
name: Create Dynamic Environment
128+
needs: [metadata, dependencies, commit-stage]
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/[email protected]
132+
- name: Trigger dynamic environment creation
133+
env:
134+
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
135+
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
136+
shell: bash
137+
run: |
138+
.github/scripts/dispatch_internal_repo_workflow.sh \
139+
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
140+
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
141+
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
142+
--targetEnvironment "pr${{ github.event.number }}" \
143+
--targetComponent "branch" \
144+
--targetAccountGroup "nhs-notify-template-management-dev" \
145+
--terraformAction "apply" \
146+
--overrides "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
124147
acceptance-stage: # Recommended maximum execution time is 10 minutes
125148
name: "Acceptance stage"
126-
needs: [metadata, dependencies, test-stage]
149+
needs: [metadata, dependencies, test-stage, pr-create-dynamic-environment]
127150
uses: ./.github/workflows/stage-4-acceptance.yaml
128151
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')
129152
secrets: inherit

.github/workflows/pr_create_dynamic_env.yaml

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

0 commit comments

Comments
 (0)