Create separate environments for development, staging, and production. Config and secrets for each environment are isolated, no need to worry about production config leaking to development.
Why it matters
Create environments with their own config and secrets: development, staging and production, all separate.
Set specific branches to specific environments. Main to production, develop to staging.
Databases and caches can be shared between environments or separated as needed.
Connect different branches to different environments, for example develop to staging and main to production.
Steps
Open the Settings > Environments tab. Click Add Environment and give it a name (e.g., staging).
Add different environment variables for each environment.
Choose the target environment when deploying. You can deploy to staging first, then to production.
Blog
FAQ
More features