Publishing · Branches & publishing
For developers
Underneath, a save is a commit pushed to the preview branch (in the background,
a few seconds after the last change), and publishing promotes those files to the
live branch — in Orbit by default, or through your git host’s review with
goLive: pullRequest. A request to publish is a small file in the repo
(orbit.requests.json on the preview branch). Details at the bottom of Unpublished shows the branches, and Undo last publish reverts the most recent
publish so it shows as unpublished again.
Two shapes, driven by config
branches:
default: preview # the preview (testing) branch saves go to
live: main # the branch your live site is built from (default main)
- Separate preview branch (
default: preview,live: main) — the usual flow: saves go to preview, publishing takes them live. - One branch (
defaultandliveare the same) — there’s no preview step: saving keeps changes on this computer, and Publish puts them live directly.
Preview & live links
Set the built URLs and Orbit adds Preview ↗ to the Page tab and a link at the top of Unpublished:
site:
previewUrl: https://preview.example.com
liveUrl: https://example.com
Set up (developers)
- Create the preview branch on your remote (e.g.
preview) and set it asbranches.default. Setbranches.liveto your live branch (defaultmain). - Set up GitHub — editors need Write access; protect the live branch and put approvers on its bypass list (step by step).
- Deploy both branches so preview and live have real sites, and set
site.previewUrl/site.liveUrl. See Astro’s Deploy guides for your host.