-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (51 loc) · 1.48 KB
/
clean-up.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
name: Clean Up
on:
# push:
# branches:
# - main
workflow_dispatch:
concurrency: development
env:
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_ACCOUNT_ID: ${{ vars.AWS_ACCOUNT_ID }}
APPLICATION_ID: ${{ vars.APPLICATION_ID }}
ENVIRONMENT: ${{ github.ref_name }}
IMAGE_TAG: ${{ github.run_number }}-${{ github.run_attempt}}
CPU_SPEC: ${{ vars.CPU_SPEC }}
MEMORY_SPEC: ${{ vars.MEMORY_SPEC }}
NEXT_PUBLIC_BASE_URL: ${{ vars.NEXT_PUBLIC_BASE_URL }}
BUILD_ID: ${{ github.run_id }}
BUILD_NUMBER: ${{ github.run_number }}-${{ github.run_attempt}}
BUILD_SOURCE_VERSION: ${{ github.sha }}
jobs:
cdk_destroy:
name: Destroy the CDK
runs-on: ubuntu-latest
environment: Development
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_ROLE}}
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: infra/yarn.lock
- name: Install project dependencies
run: cd infra && yarn install
- name: CDK destroy
working-directory: infra
run: |
yarn cdk destroy --all --force