Multiple staging branches with projects

Use CloudCannon Projects to enable advanced publishing workflows.

The advanced publishing workflow described on this page is only available on the Team plan.

In some cases, a single staging environment might not be enough. If your team is working on multiple long-running projects at once, you might often find yourself in situations where finished changes are blocked by unrelated, unfinished changes on the same staging branch. Ideally you would publish these changes independently, but the staging branch can only be merged as a whole.

One solution to this problem is to create a new branch for each separate piece of work. This means you can merge each branch when it is ready, without being blocked by other pieces of work. This is a workflow that can be achieved in CloudCannon with Projects.

In this guide, we'll extend our existing workflow so that your team can branch off, and merge back into, your staging branch. The production environment will still only be changed when merging from staging to production, which means you have one last chance to review all your changes together before they go out live. If this is too much administrative overhead for your team, it's just as easy to have multiple branches that merge straight into production, or any other workflow you can imagine with Git branches.

Setting up a Project#

Navigate to Projects in the sidebar, and click Create your first project (or Create project if this isn't your first).

Enter a descriptive name for your project, and select the Git repository you have already connected.

You will be asked to specify the Main Branch for the project. This determines where to branch off from when creating new sites. If you've been following along with this guide, this should be staging.

The Preview Details menu allows you to configure the appearance of the Project overview in CloudCannon. You don't need to touch this for now.

Click Create Project to finish creating the project.

Creating branch sites#

Click Add new site in the Sites section of the Project settings. This will create a new Git branch, branching from staging, and immediately connect it to a new site on CloudCannon with all the same build settings as your staging site. This new site will be automatically configured to publish back into the staging branch.

This enables a workflow where members of your team can easily:

  1. Create a branch site;
  2. Make changes and preview them on a testing domain;
  3. When ready, merge those changes into the staging branch;
  4. When everything on the staging branch is ready to go, merge into production.

The immediate benefit of this workflow is that the staging branch will rarely have any unfinished changes, so you can merge from staging to production quite freely.

To prevent your organization becoming cluttered with sites representing finished and published changes, branch sites will automatically have the Delete this site after publish option turned on. You can toggle this in the site settings, under Publishing.

Open in a new tab