Skip to content

Deployment

Docs (AWS CDK + GitHub Actions)

Documentation is deployed to docs.cqr.cch726.shardlab.io via S3 + CloudFront.

Infrastructure (CDK)

The CDK stack in apps/infra/ creates:

  • S3 Bucket — Stores built VitePress static files (private, OAC access only)
  • CloudFront Distribution — CDN with HTTPS, cache optimization
  • ACM Certificate — SSL certificate (us-east-1, DNS validation)
  • Route53 Records — A/AAAA records pointing to CloudFront

First-time Setup

bash
# 1. Install CDK dependencies
pnpm install

# 2. Build docs first
pnpm build:docs

# 3. Deploy infrastructure + upload files
pnpm --filter @corporate-qr/infra deploy:docs

After the first deploy, note the S3 bucket name and CloudFront distribution ID from the CDK output. Set these as GitHub Secrets for CI/CD.

Manual Deploy

bash
# Full deploy (build + upload + invalidate cache)
pnpm deploy:docs

# Preview infrastructure changes
pnpm --filter @corporate-qr/infra diff:docs

# Generate CloudFormation template
pnpm --filter @corporate-qr/infra synth:docs

# Destroy all resources
pnpm --filter @corporate-qr/infra destroy:docs

CI/CD (GitHub Actions)

Push to main branch with changes in apps/docs/ triggers automatic deployment.

Required GitHub Secrets:

SecretDescription
AWS_ROLE_ARNOIDC role ARN for AWS credential assumption
DOCS_S3_BUCKETS3 bucket name (from CDK output)
DOCS_CF_DISTRIBUTION_IDCloudFront distribution ID (from CDK output)
SLACK_WEBHOOK_URLSlack webhook for notifications (optional)

Web (Vercel)

  1. Connect GitHub repository to Vercel
  2. Set root directory to apps/web
  3. Set environment variables in Vercel dashboard:
    • NEXT_PUBLIC_SUPABASE_URL
    • NEXT_PUBLIC_SUPABASE_ANON_KEY
    • SUPABASE_SERVICE_ROLE_KEY
    • DATABASE_URL
  4. Push to main branch triggers automatic deployment

Mobile (EAS Build)

bash
cd apps/mobile
eas build --platform ios
eas build --platform android

Database (Supabase Cloud)

bash
# Link to cloud project (one-time)
supabase link --project-ref <project-id>

# Push migrations
pnpm db:push