VED-924 (Also contains VED-925 and VED-926) Modify ack file creation and completion process #189
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 Teardown | |
| on: | |
| pull_request: | |
| types: [closed] | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: The PR number of the environment to teardown e.g 123 | |
| required: true | |
| type: string | |
| jobs: | |
| teardown: | |
| name: PR Teardown | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: dev | |
| env: | |
| APIGEE_ENVIRONMENT: internal-dev | |
| BACKEND_ENVIRONMENT: dev | |
| BACKEND_SUB_ENVIRONMENT: pr-${{ github.event_name == 'pull_request' && github.event.pull_request.number || inputs.pr_number }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Connect to AWS | |
| uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 | |
| with: | |
| aws-region: eu-west-2 | |
| role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/auto-ops | |
| role-session-name: github-actions | |
| - name: Whoami | |
| run: aws sts get-caller-identity | |
| - name: Checkout | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd | |
| - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd | |
| with: | |
| terraform_version: "1.12.2" | |
| - name: Terraform Init and extract MNS SQS QUEUE ARN | |
| working-directory: infrastructure/instance | |
| run: | | |
| make init apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT | |
| make workspace apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT | |
| echo "ID_SYNC_QUEUE_ARN=$(make -s output name=id_sync_queue_arn)" >> $GITHUB_ENV | |
| - name: Install poetry | |
| run: pip install poetry==2.1.4 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| cache: "poetry" | |
| cache-dependency-path: | | |
| lambdas/mns_subscription/poetry.lock | |
| lambdas/shared/poetry.lock | |
| - name: Unsubscribe MNS | |
| working-directory: "./lambdas/mns_subscription" | |
| env: | |
| APIGEE_ENVIRONMENT: int | |
| SQS_ARN: ${{ env.ID_SYNC_QUEUE_ARN }} | |
| run: | | |
| poetry install --no-root | |
| echo "Unsubscribing SQS to MNS for notifications..." | |
| make unsubscribe | |
| - name: Terraform Destroy | |
| working-directory: infrastructure/instance | |
| run: | | |
| make destroy apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT |