Skip to content

feat(infra): add SST infrastructure with Cloudflare deployment#6

Merged
andrewmelchor merged 2 commits intomainfrom
feat/infra-sst-setup
Jan 22, 2026
Merged

feat(infra): add SST infrastructure with Cloudflare deployment#6
andrewmelchor merged 2 commits intomainfrom
feat/infra-sst-setup

Conversation

@andrewmelchor
Copy link
Copy Markdown
Member

Summary

Add SST v3 infrastructure with Cloudflare deployment for the webdocs site. This establishes the foundation for automated
preview deployments, staging, and production releases.

Key changes:

  • SST config with Cloudflare as home provider for state management
  • Stage-based domain routing (production → docs.t-req.io, dev → dev.docs.t-req.io, PR previews → pr-{N}.docs.t-req.io)
  • GitHub Actions workflows for CI/CD automation
  • Root tsconfig.json for SST TypeScript type definitions
  • Relocated webdocs from apps/ to packages/

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring
  • Chore (dependency update, build script changes, etc.)

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual testing (please describe)
    Manual testing performed:
    • Deployed to personal stage (andrew) via bunx sst deploy --stage andrew
    • Verified webdocs site builds and deploys to Cloudflare Workers
    • Confirmed SST TypeScript types resolve correctly in IDE

Checklist

  • I have followed the contributing guidelines
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • My changes generate no new warnings

  - Set up SST v3 with Cloudflare as home provider
  - Add stage-based deployment (production, dev, pr-{N} previews)
  - Configure GitHub Actions workflows:
    - PR previews with auto-cleanup on close
    - Auto-deploy to dev on push to main
    - Manual dispatch for production
  - Move webdocs from apps/ to packages/
  - Add root tsconfig.json for SST type definitions

  Domains:
  - production: docs.t-req.io
  - dev: dev.docs.t-req.io
  - pr previews: pr-{N}.docs.t-req.io
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 22, 2026

🚀 Preview Deployment

Your changes have been deployed to:

📖 Docs: https://docs-pr-6.t-req.io

This preview will be automatically removed when the PR is closed.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Jan 22, 2026

Greptile Summary

Establishes SST v3 infrastructure for automated Cloudflare deployments of the webdocs site with stage-based domain routing.

Key changes:

  • SST config with Cloudflare as the home provider for state and hosting
  • Three-tier deployment strategy: production (docs.t-req.io), dev (dev.docs.t-req.io), and PR previews (pr-N.docs.t-req.io)
  • GitHub Actions workflows for automated CI/CD: PR previews, dev deployments on main push, manual production releases, and preview cleanup
  • Root tsconfig.json added for SST TypeScript type definitions
  • Webdocs relocated from apps/ to packages/ directory
  • Production stage protected with removal: 'retain' and protect: true

Issues found:

  • Production deployment summary displays incorrect URL (docs.t-req.dev instead of docs.t-req.io)

Confidence Score: 4/5

  • Safe to merge with one minor URL typo fix needed
  • Infrastructure is well-structured with proper stage protection, fork handling, and cleanup workflows. The only issue is a typo in the deployment summary URL which doesn't affect functionality
  • .github/workflows/deploy-production.yml - contains incorrect production URL in deployment summary

Important Files Changed

Filename Overview
.github/workflows/deploy-production.yml Manual production deployment workflow with typo in summary URL
.github/workflows/deploy.yml Automated PR preview and dev deployments with proper fork handling
sst.config.ts SST config with Cloudflare provider and stage-based protection
infra/stage.ts Stage-based domain routing logic for production, dev, and PR previews
infra/webdocs.ts Cloudflare StaticSite resource for webdocs deployment

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub
    participant Actions as GitHub Actions
    participant SST as SST CLI
    participant CF as Cloudflare
    participant DNS as DNS (t-req.io)

    Note over Dev,DNS: PR Preview Flow
    Dev->>GH: Open/Update Pull Request
    GH->>Actions: Trigger deploy.yml workflow
    Actions->>Actions: Install dependencies & build
    Actions->>SST: bunx sst deploy --stage pr-N
    SST->>CF: Deploy to Workers (pr-N.docs.t-req.io)
    CF->>DNS: Configure subdomain
    DNS-->>CF: DNS configured
    CF-->>SST: Deployment complete
    SST-->>Actions: Success
    Actions->>GH: Comment with preview URL

    Note over Dev,DNS: Dev Deployment Flow
    Dev->>GH: Push to main branch
    GH->>Actions: Trigger deploy.yml workflow
    Actions->>Actions: Install dependencies & build
    Actions->>SST: bunx sst deploy --stage dev
    SST->>CF: Deploy to Workers (dev.docs.t-req.io)
    CF->>DNS: Configure subdomain
    DNS-->>CF: DNS configured
    CF-->>SST: Deployment complete
    SST-->>Actions: Success

    Note over Dev,DNS: Production Deployment Flow
    Dev->>GH: Manual workflow dispatch
    GH->>Actions: Trigger deploy-production.yml
    Actions->>Actions: Install dependencies & build
    Actions->>SST: bunx sst deploy --stage production
    SST->>CF: Deploy to Workers (docs.t-req.io)
    CF->>DNS: Configure domain
    DNS-->>CF: DNS configured
    CF-->>SST: Deployment complete (retained)
    SST-->>Actions: Success
    Actions->>GH: Deployment summary

    Note over Dev,DNS: Cleanup Flow
    Dev->>GH: Close Pull Request
    GH->>Actions: Trigger cleanup.yml workflow
    Actions->>SST: bunx sst remove --stage pr-N
    SST->>CF: Remove Workers deployment
    CF-->>SST: Cleanup complete
    SST-->>Actions: Success
Loading

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

53 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@andrewmelchor andrewmelchor merged commit d9b50f7 into main Jan 22, 2026
2 of 3 checks passed
@andrewmelchor andrewmelchor deleted the feat/infra-sst-setup branch January 22, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant