Available with GitHub syncing.
Publishing allows editors to merge changes from one branch to another. You can choose to merge directly or with a pull request. Selecting a publish branch enables the publish interface for your site. This is useful for staging sites.
To connect a publish branch and enable publishing, follow these instructions:
Go to Site Settings / File Syncing / Publish and click Add Publish Branch next to GitHub.
Select the branch you want to merge into and click Use Branch. This will fail if there is no additional branch in the repository.
All editors will have access to the Publish option in the sidebar. Clicking Publish Latest Changes will attempt a merge from the syncing branch to the publish branch. If there are any changes pending these will be displayed below the publish button.
Removing a publish branch
Go to Site Settings / File Syncing / Publish and click Remove Publish Branch next to GitHub.
The publish interface becomes unavailable to all editors without a publish branch set.
The publish mode determines if publish is a direct merge or a pull request. Merges have less overhead, while pull requests can link to external builds, checks and workflows.
To change the publish mode for a GitHub-connected site:
- Go to Site Settings / File Syncing / Publish
- Select Merge or Pull Request
- Click Change Publish Mode
Pull requests are called Publish Requests in CloudCannon to better fit the publish workflow for editors. Publish Requests provide an intermediate step for publishing, where external services connected to the GitHub Status API check the changes pass your requirements.
Any pull requests that are not from the connected branch to publish branch are hidden in CloudCannon.
The workflow with this publish mode is:
- Make changes to site
- Create a Publish Request
- Review the request, along with any checks from the GitHub Status API
- Publish or Close the request
Publish merges the changes into the publish branch, while Close cancels the Publish Request. Changes made are not reversed after closing a Publish Request.