Initial sandbox proxy deploy #47
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Destroy Environment | |
| on: | |
| pull_request: | |
| types: [closed] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| create-dynamic-environment: | |
| name: Destroy Dynamic Environment | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger nhs-notify-internal dynamic environment destruction | |
| shell: bash | |
| run: | | |
| set -x | |
| this_repo_name=$(echo ${{ github.repository }} | cut -d'/' -f2) | |
| DISPATCH_EVENT=$(jq -ncM \ | |
| --arg infraRepoName "${this_repo_name}" \ | |
| --arg releaseVersion "main" \ | |
| --arg targetProject "nhs" \ | |
| --arg targetEnvironment "pr${{ github.event.number }}" \ | |
| --arg targetAccountGroup "nhs-notify-supplier-api-dev" \ | |
| --arg targetComponent "api" \ | |
| --arg terraformAction "destroy" \ | |
| --arg overrideProjectName "nhs" \ | |
| --arg overrideRoleName "nhs-main-acct-supplier-api-github-deploy" \ | |
| '{ "ref": "main", | |
| "inputs": { | |
| "infraRepoName": $infraRepoName, | |
| "releaseVersion", $releaseVersion, | |
| "targetProject", $targetProject, | |
| "targetEnvironment", $targetEnvironment, | |
| "targetAccountGroup", $targetAccountGroup, | |
| "targetComponent", $targetComponent, | |
| "terraformAction", $terraformAction, | |
| "overrideProjectName", $overrideProjectName, | |
| "overrideRoleName", $overrideRoleName, | |
| } | |
| }') | |
| curl --fail -L \ | |
| -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PR_TRIGGER_PAT }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/dispatch-deploy-dynamic-env.yaml/dispatches \ | |
| -d "${DISPATCH_EVENT}" |