Configure automated deployments with GitHub and SST
// sst.config.ts export default $config({ app(input) { return { name: "my-app", stage: input.stage, }; }, console: { autodeploy: { target(event) { // Deploy main branch to production if (event.type === "branch" && event.branch === "main") { return { stage: "production" }; } // Deploy develop branch to staging if (event.type === "branch" && event.branch === "develop") { return { stage: "staging" }; } // Deploy PRs to preview environments if (event.type === "pr") { return { stage: `pr-${event.pr}` }; } } } } });
# Production STAGE=production DOMAIN=yourdomain.com STRIPE_KEY=sk_live_... # Staging STAGE=staging DOMAIN=staging.yourdomain.com STRIPE_KEY=sk_test_...
main
develop
pr-*
# Deploy to staging git checkout develop git commit -m "feat: new feature" git push origin develop # Deploy to production git checkout main git merge develop git push origin main
Was this page helpful?