Skip to content

feat: ✨ implement larc caching #64

feat: ✨ implement larc caching

feat: ✨ implement larc caching #64

Workflow file for this run

# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: Destroy CloudFormation stacks and staging environment for pull request
on:
pull_request:
types:
- closed
- labeled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
pull-requests: write
deployments: write
repository-projects: write
env:
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: us-east-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}
NODE_ENV: staging
PR_NUM: ${{ github.event.pull_request.number }}
jobs:
destroy-api:
name: Destroy API CloudFormation stack and staging environment for pull request
if: (github.event.action == 'labeled' && github.event.label.name == 'no deploy') || github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build API
run: pnpm build --filter="@apps/api"
- name: Destroy API CloudFormation stack
run: pnpm --filter="@apps/api" cdk-app destroy
- name: Set API staging environment to inactive
uses: strumwolf/delete-deployment-environment@a4825dd9648c57da8437a4885c3fcad58beac69c # v3.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: staging-${{ github.event.pull_request.number }}
onlyDeactivateDeployments: true
destroy-documentation:
name: Destroy documentation CloudFormation stack and staging environment for pull request
if: (github.event.action == 'labeled' && github.event.label.name == 'no deploy') || github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build documentation
run: pnpm build --filter="@apps/docs"
- name: Destroy documentation CloudFormation stack
run: pnpm --filter="@tools/cdk" docs destroy
- name: Set documentation staging environment as inactive
uses: strumwolf/delete-deployment-environment@a4825dd9648c57da8437a4885c3fcad58beac69c # v3.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: staging-${{ github.event.pull_request.number }}-docs
onlyDeactivateDeployments: true