-
-
Notifications
You must be signed in to change notification settings - Fork 14
52 lines (47 loc) · 1.69 KB
/
aws-nuke.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
name: 'aws-nuke'
on:
# Enable manual runs
workflow_dispatch:
inputs:
delete:
description: 'Set to "true" to actually delete stuff'
required: true
default: 'false'
# Enable pull request for testing
pull_request:
types: [opened, synchronize, reopened]
# Nuke testing account nightly
schedule:
# Run at noon UTC, 4 or 5am PT
- cron: '0 12 * * *'
jobs:
# Run aws-nuke simulation (don't actually delete anything)
dry-run:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || ( github.event_name == 'workflow_dispatch' && github.event.inputs.delete != 'true' )
steps:
- name: checkout
uses: actions/checkout@v2
- name: aws-nuke
uses: "docker://quay.io/rebuy/aws-nuke:v2.19.0"
with:
args: "--config .github/aws-nuke.yaml --force"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
# Run aws-nuke "for reals" (delete everything)
no-dry-run:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && github.event.inputs.delete == 'true' )
steps:
- name: checkout
uses: actions/checkout@v2
- name: aws-nuke
uses: "docker://quay.io/rebuy/aws-nuke:v2.19.0"
with:
args: "--config .github/aws-nuke.yaml --force --no-dry-run"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"