Skip to content

Roll out frontend code ​

New frontend code reaches live through the preview. Every page is rebuilt against the new code first; code and pages then go live together as one site release. Live never gets a mix of old and new code.

Content: edit in any source, sync and review the preview, select the pages and publish them; the rest stay drafts and the live code is kept. Code: push to main, the code is saved as a fixed version and every page is rebuilt in the preview; the release, automatic when the checks pass or by hand, makes pages and code live together. Roll back one step returns to the version before. A pushed branch gets its own preview address with that code and the preview content, and never goes live.Content: edit in any source, sync and review the preview, select the pages and publish them; the rest stay drafts and the live code is kept. Code: push to main, the code is saved as a fixed version and every page is rebuilt in the preview; the release, automatic when the checks pass or by hand, makes pages and code live together. Roll back one step returns to the version before. A pushed branch gets its own preview address with that code and the preview content, and never goes live.

Automatic or by hand ​

The site setting codeRelease decides what a push to main does once every page is rebuilt:

codeReleaseA push to main
auto (the default, also for existing sites)Released at once when the automatic checks pass: merge to main = release. When a check fails, the code waits in the preview with the reason, and live does not change.
manualWaits in the preview until you review it and press Release.

The automatic checks: every live page was rebuilt against the new code, no page shows a problem (a block the code cannot build), the code declares every block, component and template the pages use, the preview is still exactly that rebuild, and live did not change meanwhile. The release then names exactly the preview and code that this deploy prepared; nothing else can be released by it.

Change the setting in the dashboard (Frontend › Code release), with foliwake site set codeRelease manual on a server that keeps its sites in a database, or in foliwake.config.json:

json
{ "id": "docs-site", "codeRelease": "manual", "…": "…" }

The steps ​

  1. Push to main. The frontend repository's production workflow asks the Foliwake server to deploy that commit (foliwake code deploy --rev <sha>). The server makes a code release from it and rebuilds every live page against it in the site's preview. With auto it then runs the checks and releases; the workflow's summary shows released, or prepared with the reason and the checks that failed.

    The pages are rebuilt from their current sources, not from the text that is live. If someone edited a live page since it was published, that edit goes live with the release. Pages that were never published stay out, unless you add them with migration prepare --add.

  2. Review the preview (when the code waits). In the dashboard, open Frontend › New code. It shows the commit, the code release, when the pages were rebuilt, why an automatic release was held, and a link to the preview. It also says what the release changes: the new code applies to all pages, and the page text that changed since live, page by page. It lists pages new on the site, pages leaving it, and pages with problems.

  3. Release. Release makes the reviewed code and pages live as one site release. It is refused if live or the preview changed since you looked, or if a page still has problems.

  4. Roll back if needed. Roll back one step makes the release before live again: code and pages as they were.

The same steps from the CLI:

bash
foliwake code deploy --rev <sha> --sequence <n>    # prepare, rebuild and (auto) release: one command
foliwake code prepare --rev <sha>                  # or step by step: prints cd_…; live unchanged
foliwake migration prepare cd_… --rev <sha>        # every page rebuilt in preview; prints sr_…
foliwake migration commit --expect sr_…@cd_…       # code and pages go live together
foliwake site status --json                        # codeRollout: mode, lastDeploy, rollbackTo
foliwake release rollback <sr_…> --expect <live sr_…>

--expect names what you reviewed. For a rollback it is the live release you saw, so a rollback never drops a release nobody looked at. When live is itself a rollback, there is no one-step roll back in the dashboard; name the release you want with release rollback.

Soft checks before the release ​

A block the new code does not know, or block content its definition does not accept, does not stop the rebuild. The page is built with a visible warning box in the preview, and New code lists it under pages with problems. Release refuses while such a page remains: fix the content or the code, then push again.

Mistakes in the content itself, such as an unclosed ::: block, stay errors. See preview and publish.

Who may do what ​

Stepadmindeveloperauthor
Prepare code and rebuild the previewyesyesno
code deploy of a site with codeRelease: auto (it may release)yeswith live accessno
code deploy of a site with codeRelease: manualyesyesno
Releaseyeswith live accessno
Roll back the siteyeswith live accessno

See accounts, roles and sign-in.

While new code waits ​

The site has one preview, and while new code waits there it shows the future live: the new code with the current pages.

  • Updating the preview keeps the new code. A preview of a few pages builds them on the new code and keeps the other pages; a preview of every page rebuilds them all on it. The code keeps waiting for its release. A page that is not live yet and that you preview now joins the site with that release (New code lists it as new on the site).
  • Publishing a page builds it on the code that is live, so live never mixes old and new code. The dashboard warns before you confirm: new code is waiting in preview; the page goes live on the current code, not exactly as previewed. Release the new code first to publish it as previewed.
  • The release still goes ahead after such a publication, because the preview already holds that page's text. It is refused when live changed in a way the preview does not hold (a page published from text the preview does not have, or any code change on live); prepare the code again then (push again, or code deploy).
  • Only an explicit preview with other code (preview --code) replaces the waiting release.

Emergencies ​

foliwake code release <cd_…> --expect <live sr_…> (or --latest-live) switches live code alone and keeps live content. It skips the rebuild and the review, so use it only in an emergency. foliwake code rollback <previous cd_…> --latest-live brings back earlier code without changing content.

The workflow in the repository ​

A project made with foliwake create includes this workflow (.github/workflows/production.yml). It is inert until the repository is connected; see branch previews. Its key runs code deploy for the tip of main (so with codeRelease: auto it releases when the checks pass) and rolls back; it cannot release any other preview. A manual run of the workflow rolls back: give it the target (previous or a release sr_…) and the live release you saw.