-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.86 KB
/
delete-curl-performance-test-common.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: delete-common-stacks
on:
workflow_dispatch:
inputs:
account:
description: "Alias of the AWS account to be applied to"
required: true
defaults:
run:
shell: bash
jobs:
echo-parameters:
name: parameters
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: account ${{ github.event.inputs.account }}
run: echo
delete-curl-performance-test-common:
name: Delete curl-performance-test-common
runs-on: ubuntu-latest
environment:
name: production
env:
region: ap-southeast-2
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4.0.2
env:
AWS_ACCESS_KEY_ID_NAME: ${{ github.event.inputs.account }}_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY_NAME: ${{ github.event.inputs.account }}_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: ${{ env.region }}
with:
aws-access-key-id: ${{ secrets[env.AWS_ACCESS_KEY_ID_NAME] }}
aws-secret-access-key: ${{ secrets[env.AWS_SECRET_ACCESS_KEY_NAME] }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- run: echo "accountid=$(aws sts get-caller-identity | jq -r .Account)" >> $GITHUB_ENV
- id: Bucket
env:
bucket-suffix: ${{ secrets.BUCKET_SUFFIX }}
run: |
echo "name=curl-performance-test-${{ env.accountid }}-${{ env.region }}-${{ env.bucket-suffix }}" >> $GITHUB_OUTPUT
- name: Empty the S3 bucket before deletion
run: aws s3 rm s3://${{ steps.Bucket.outputs.name }} --recursive
- name: Delete curl-performance-test-common stack
run: aws cloudformation delete-stack --stack-name curl-performance-test-common
- name: Wait until curl-performance-test-common stack delete complete
run: aws cloudformation wait stack-delete-complete --stack-name curl-performance-test-common