Skip to content

Write to both DynamoDB and RDS #131

Write to both DynamoDB and RDS

Write to both DynamoDB and RDS #131

# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: Destroy CloudFormation stacks for staging
on:
pull_request:
types:
- closed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
deployments: write
env:
# Tooling settings.
HUSKY: 0
NODE_ENV: staging
# Application information.
MONGODB_URI_PROD: ${{ secrets.MONGODB_URI_PROD }}
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
VITE_TILES_ENDPOINT: ${{ secrets.VITE_TILES_ENDPOINT}}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
ANTEATER_API_KEY: ${{ secrets.ANTEATER_API_KEY }}
# Turborepo credentials.
TURBO_API: ${{ vars.TURBO_API }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: team_antalmanac
# AWS credentials.
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
# Information used by AWS CDK stacks.
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
PR_NUM: ${{ github.event.pull_request.number }}
STAGE: dev
jobs:
destroy_staging_frontend:
name: Destroy frontend staging CloudFormation stack and environment
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build frontend
run: pnpm --filter "antalmanac" build
- name: Destroy frontend staging CloudFormation stack
run: pnpm --filter "antalmanac-cdk" frontend-staging destroy --force
- name: Delete deployment
uses: ./.github/actions/delete-deployment
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
environment: staging-backend
name: frontend-staging-${{ github.event.pull_request.number }}
destroy_staging_backend:
name: Destroy backend staging CloudFormation stack and environment
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build backend
run: pnpm --filter "antalmanac-backend" build
env:
ANTEATER_API_KEY: ${{ secrets.ANTEATER_API_KEY }}
- name: Destroy backend staging CloudFormation stack
run: pnpm --filter "antalmanac-cdk" backend-staging destroy --force
- name: Delete deployment
uses: ./.github/actions/delete-deployment
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
environment: staging-backend
name: backend-staging-${{ github.event.pull_request.number }}