-
Notifications
You must be signed in to change notification settings - Fork 617
65 lines (55 loc) · 1.78 KB
/
cleanup.yml
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
59
60
61
62
63
64
65
# Destroys any cloud infrastructure that was deployed for the purpose of E2E testing.
name: Cloud infrastructure Cleanup
on:
repository_dispatch:
types: [cleanup-infrastructure]
schedule:
- cron: "0 2 * * *" # Every day at 2AM.
jobs:
aws-nuke:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
container:
image: rebuy/aws-nuke
options: --user root -v ${{ github.workspace }}:/workspace
steps:
- uses: actions/checkout@v3
- name: Run AWS Nuke
run: >
aws-nuke
--config ./.github/workflows/cleanup/aws-nuke.yml
--no-dry-run
--force
--force-sleep 3
--max-wait-retries 100
--access-key-id ${{ env.AWS_ACCESS_KEY_ID }}
--secret-access-key ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-eventbridge-cleanup:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn --immutable
aws-cloudfront-functions-cleanup:
runs-on: ubuntu-latest
needs: [aws-nuke]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn --immutable
- name: Run Cloudfront Functions Cleanup
run: node ./.github/workflows/cleanup/cleanupCloudfrontFunctions.js