-
-
Notifications
You must be signed in to change notification settings - Fork 204
51 lines (44 loc) · 1.46 KB
/
pull_request_close.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
name: Pull Request Delete
on:
pull_request:
types: [closed]
branches: [master]
paths-ignore:
- 'tools/bumblebee/**'
jobs:
pr_delete:
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Checkout
uses: actions/checkout@v2
- name: Restore npm cache
uses: actions/cache@v2
env:
cache-name: cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-
- name: Install Dependencies
working-directory: setup/cdk
run: npm ci
- name: Delete Stack
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-central-1
working-directory: setup/cdk
run: |
npx cdk destroy --force --all -c feature=pr${{ github.event.pull_request.number }} -c deployId=${GITHUB_RUN_ID}
- name: Delete Deployment
uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.DELETE_ENV_TOKEN }}
environment: pr${{ github.event.pull_request.number }}