Deploy a branch to its own environment
Create an environment such as staging that deploys from its own branch, away from production.
All pages
- Open the project, open its environment menu and choose Manage environments, then New environment.
With the CLI:
Terminalghaym cloud environments create --project shop --name staging --branch staging - Type the Environment name, pick the Branch it deploys from, and choose Create environment.
Every service in the project gets a place in the new environment, with production's settings and access copied once. Change them there to build it differently; a change in one environment never reaches another. Each database there starts empty: environments never share data.
- Push to the branch. To deploy before your next push, open a service in the environment, press ⌘K and choose Deploy.
Each push to it builds and deploys the environment's services.
Pull request previews. Until then, an environment deploys from the branch you pick, not from a pull request.
Pick the environment in the same menu to open it. Unlike production, it sleeps after 15 minutes without a request.
Search engines don't index it: its responses carry X-Robots-Tag: noindex. To have it indexed, send your own X-Robots-Tag header from the app.
In Manage environments, choose Delete beside it, type its name and choose Delete environment. Its deploys, variables and databases are deleted with it.
ghaym cloud environments delete staging --project shop --confirm