Deploy a branch to its own environment

Create an environment such as staging that deploys from its own branch, away from production.

Create the environment

  1. Open the project, open its environment menu and choose Manage environments, then New environment.

    With the CLI:

    Terminal
    ghaym cloud environments create --project shop --name staging --branch staging
  2. 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.

  3. 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.

Coming soon

Pull request previews. Until then, an environment deploys from the branch you pick, not from a pull request.

Check it

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.

Delete it

In Manage environments, choose Delete beside it, type its name and choose Delete environment. Its deploys, variables and databases are deleted with it.

Terminal
ghaym cloud environments delete staging --project shop --confirm