-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.32 KB
/
destroy.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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: destroy
on:
pull_request:
branches:
- main
types:
- closed
jobs:
destroy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12.0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: github-actions-session
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Set CDK Application Stage
id: stage
run: echo ::set-output name=stage::"pr-${{ github.event.number }}"
- name: Destroy
run: |-
npx projen destroy \
--context stage=${{ steps.stage.outputs.stage }} \
--force
- name: Deactivate GitHub Deployment
uses: bobheadxi/deployments@v1
with:
step: deactivate-env
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ steps.stage.outputs.stage }}
desc: environment deactivated after destroy