-
Notifications
You must be signed in to change notification settings - Fork 463
🚁 Create a staging environment deployment for pull requests #1070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚁 Create a staging environment deployment for pull requests #1070
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements per-PR staging environments using Fly.io's PR preview feature, replacing the previous single shared staging environment to enable parallel testing and eliminate staging bottlenecks.
Key Changes:
- Automated per-PR staging deployments with isolated resources (database, secrets, storage)
- Removed manual staging app setup from initialization process
- Migrated staging secrets from Fly.io to GitHub environment secrets
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/deploy.yml |
Added deploy-staging job for per-PR environments, removed dev branch deployments, automated resource provisioning |
remix.init/index.mjs |
Removed staging app creation and setup prompts from initialization script |
prisma/seed.staging.sql |
New staging database seed file with test users and notes data |
other/litefs.yml |
Added automatic seeding of staging databases on first deployment |
docs/deployment.md |
Updated deployment instructions removing staging app setup, added GitHub CLI requirement |
docs/secrets.md |
Updated to use GitHub environment secrets for staging instead of Fly secrets |
docs/email.md |
Updated secret management commands for new workflow |
docs/monitoring.md |
Updated Sentry DSN configuration for staging environments |
docs/database.md |
Added documentation for staging database seeding |
docs/decisions/047-pr-staging-environments.md |
Decision record documenting the rationale and impact of the change |
prisma/migrations/migration_lock.toml |
Formatting change (no functional impact) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
02329aa to
c71c12a
Compare
c71c12a to
b01f047
Compare
b01f047 to
d123c21
Compare
andrecasal
commented
Dec 29, 2025
Amazing @kasperpeulen, thanks for this!
d123c21 to
2a62f07
Compare
2a62f07 to
2cad253
Compare
c2e8cf8 to
dc29c59
Compare
dc29c59 to
1c0c941
Compare
@kentcdodds
kentcdodds
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This improves a lot! Thanks!
Why don't we use GitHub for all secrets, even production? I think that would be less confusing.
Uh oh!
There was an error while loading. Please reload this page.
Closes #1067
Summary
Implements per-PR staging environments using Fly.io's API, resolving the staging bottleneck issue discussed in #1067.
Problem
Previously, the Epic Stack used a single shared staging environment (
app-name-staging) which created several issues:Solution
Each pull request now gets its own isolated staging environment with:
app-name-pr-123)Changes
CI/CD Pipeline (
.github/workflows/deploy.yml):deploy-stagingjob usingsuperfly/fly-pr-review-apps@1.5.0main(removeddevbranch)Database Seeding (
prisma/seed.staging.sql,other/litefs.yml):Documentation Updates:
docs/deployment.md: Removed staging app setup, added GitHub CLI instructionsdocs/secrets.md: Updated for GitHub environment secretsdocs/email.md,docs/monitoring.md: Updated secret commands for new workflowdocs/database.md: Added staging seed documentationBenefits
Test Plan
I tested this in my own deployed fork of the epic stack.
See here the production deploy:
https://github.com/kasperpeulen/epic-stack/deployments/production
And here a PR that creates a staging app on the fly:
kasperpeulen#27
Checklist
Screenshots
image