-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.6 KB
/
destroy-staging.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
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: Destroy staging build
on:
pull_request:
types:
- closed
- labeled
permissions:
id-token: write
contents: read
deployments: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DEV_DB_URL }}
PR_NUM: ${{ github.event.pull_request.number }}
jobs:
destroy:
if: (github.event.action == 'labeled' && github.event.label.name == 'no deploy') || github.event.action == 'closed'
runs-on: ubuntu-latest
environment:
name: staging-${{ github.event.pull_request.number }}
url: https://staging-${{ github.event.pull_request.number }}.zotmeet.com
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Destroy ZotMeet staging build
run: pnpm sst remove --stage staging-$PR_NUM
- name: Set ZotMeet staging environment to inactive
uses: strumwolf/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: staging-${{ github.event.pull_request.number }}
onlyDeactivateDeployments: true