Skip to content

Feature/ccm 11971 move pr created workflow #394

Feature/ccm 11971 move pr created workflow

Feature/ccm 11971 move pr created workflow #394

name: PR Destroy Environment
on:
pull_request:
types: [closed]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
id-token: write
contents: read
jobs:
destroy-dynamic-environment:
name: Destroy Dynamic Environment
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Trigger dynamic environment destruction
env:
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
shell: bash
run: |
.github/scripts/dispatch_internal_repo_workflow.sh \
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
--releaseVersion "main" \
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
--targetEnvironment "pr${{ github.event.number }}" \
--targetComponent "branch" \
--targetAccountGroup "nhs-notify-template-management-dev" \
--terraformAction "destroy"
sandbox-tear-down:
name: Destroy Sandbox Environment
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Trigger sandbox environment destruction
shell: bash
env:
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
run: |
.github/scripts/dispatch_internal_repo_workflow.sh \
--infraRepoName "nhs-notify-web-template-management" \
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
--targetEnvironment "pr${{ github.event.number }}" \
--targetAccountGroup "nhs-notify-template-management-dev" \
--targetComponent "sandbox" \
--terraformAction "destroy"