Skip to content

How To: Deploy

Automatic Deployment (CI/CD)

Pushing to main automatically deploys to staging via GitHub Actions.

Production deployments are triggered manually via GitHub Actions workflow dispatch.

See CI/CD Reference for full pipeline details.

Manual Deployment

To Staging

make deploy-staging
# or
npx sst deploy --stage staging

To Production

make deploy-production
# Requires confirmation prompt

Smoke Test After Deploy

make smoke-test URL=https://your-api-url.com

First-Time Setup (New Stage)

  1. Set SST secrets for the stage:

    sst secret set ClerkSecretKey sk_live_... --stage staging
    sst secret set ClerkJwtKey "-----BEGIN PUBLIC KEY-----..." --stage staging
    # ... repeat for all 12 secrets (see docs/infrastructure/sst.md)
    

  2. Deploy:

    npx sst deploy --stage staging
    

  3. Bootstrap database schema (one-time for new RDS instances):

    # The first deploy creates the RDS instance
    # Alembic migrations run automatically via the entrypoint
    

  4. Verify:

    make smoke-test URL=<api-url-from-deploy-output>
    

Rollback

SST does not have a built-in rollback command. To rollback:

  1. Revert the commit on main
  2. Push -- CI will deploy the reverted state
  3. Or deploy a specific commit: git checkout <sha> && npx sst deploy --stage staging

Prerequisites

  • AWS credentials configured (or OIDC via GitHub Actions)
  • SST secrets set for the target stage
  • See AWS OIDC Setup for CI auth