Skip to content

feat: ✨ user settings #165

feat: ✨ user settings

feat: ✨ user settings #165

# 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
repository_dispatch:
types: [remove-command]
permissions:
id-token: write
contents: read
deployments: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }}
cancel-in-progress: false
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 || github.event.client_payload.pull_request.number }}
jobs:
destroy:
if: github.event_name == 'repository_dispatch' || (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 || github.event.client_payload.pull_request.number }}
url: https://staging-${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }}.zotmeet.com
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.event.client_payload.pull_request.head.sha }}
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
# TODO (@KevinWu098): Remove this stage once SST fixes compat with Pulumi
# https://github.com/anomalyco/sst/issues/6314
- name: Setup Pulumi
uses: pulumi/actions@v5
with:
pulumi-version: 3.138.0 # Any version < 3.214.0 works
- name: Destroy ZotMeet staging build
run: pnpm sst remove --stage staging-$PR_NUM
- name: Set ZotMeet staging environment to inactive
uses: strumwolf/delete-deployment-environment@v2.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: staging-${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }}
onlyDeactivateDeployments: true
- name: Add reaction to comment
if: github.event_name == 'repository_dispatch'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: rocket