To get the most out of the staging/production workflow, you'll want to configure your
production branch carefully.
Prevent direct editing#
In this workflow, your
production branch can only be edited by merging from another branch.
production branch is edited directly, this could cause merge conflicts which can be difficult for non-technical team members to debug and fix.
To prevent editing of your site in CloudCannon, navigate to your site dashboard, then click Settings. In the Details section, check Editing Locked and click the Update Site button.
You might also want to set up protections on the branch from your Git provider. This will prevent developers on your team from committing directly to the branch. You can even ensure that certain quality assurance measures are met before changes can be merged in (for example, requiring approval from 2 team members, or requiring automated tests to pass).
Read more about the options available from your provider in the links below:
- Managing protected branches in GitHub
- Using branch permissions in Bitbucket
- Protected branches in GitLab
Make this site user facing#
production branch is what you show to your end-users. You might do this by adding a custom domain in CloudCannon or outputting the built files to another Git branch to be hosted elsewhere.
You have now ensured that your live site can only be altered by merging changes from another branch, adhering to any protections you might have configured.
In the next step, we'll look at setting up a staging site where you can make these changes, preview your work, and publish to the production environment through CloudCannon.