[CPDNPQ-2437] Fix course calculator allowed_declaration_types #1492
Workflow file for this run
This file contains 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: Delete review | |
on: | |
pull_request: | |
types: [closed] | |
branches: [main] | |
jobs: | |
delete-review-app: | |
name: Delete Review App ${{ github.event.pull_request.number }} | |
concurrency: deploy_review_${{ github.event.pull_request.number }} | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') }} | |
runs-on: ubuntu-latest | |
environment: review | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.5.4 | |
terraform_wrapper: false | |
- name: Set environment variables | |
run: | | |
state_file_name=${{ github.event.pull_request.number }}.tfstate | |
echo "TF_STATE_FILE=$state_file_name" >> $GITHUB_ENV | |
state_file_status=$(az storage blob list -c terraform-state \ | |
--account-name "s189t01cpdnpqrvtfsa" \ | |
--prefix $state_file_name --query "[].name" -o tsv) | |
if [ -n "$state_file_status" ]; then | |
echo "TF_STATE_EXISTS=true" >> $GITHUB_ENV | |
fi | |
- uses: DFE-Digital/github-actions/set-kubelogin-environment@master | |
if: env.TF_STATE_EXISTS == 'true' | |
with: | |
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Destroy Terraform | |
if: env.TF_STATE_EXISTS == 'true' | |
id: destroy-terraform | |
shell: bash | |
run: make ci review terraform-destroy | |
env: | |
TF_VAR_azure_sp_credentials_json: ${{ secrets.AZURE_CREDENTIALS }} | |
TF_VAR_statuscake_api_token: ${{ secrets.STATUSCAKE_API_TOKEN }} | |
DOCKER_IMAGE: "ghcr.io/dfe-digital/npq-registration:no-tag" | |
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} | |
- name: Set Connection String | |
run: | | |
STORAGE_CONN_STR=$(az storage account show-connection-string -g s189t01-cpdnpq-rv-rg -n s189t01cpdnpqrvtfsa --query 'connectionString') | |
echo "::add-mask::$STORAGE_CONN_STR" | |
echo "AZURE_STORAGE_CONNECTION_STRING=$STORAGE_CONN_STR" >> $GITHUB_ENV | |
- name: Delete Terraform state file | |
if: env.TF_STATE_EXISTS == 'true' | |
run: | | |
az storage blob delete -c terraform-state --name ${{ env.TF_STATE_FILE }} \ | |
--account-name "s189t01cpdnpqrvtfsa" --connection-string '${{ env.AZURE_STORAGE_CONNECTION_STRING }}' |