You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-host: rebuild the static site automatically on publish (follow-up to #143) #150
#143 / PR #148 ship the self-host Docker image with site serving option (a): cloudhal build writes static HTML to /data/dist and Caddy serves it from the volume. The image exposes this as the site-build command (docker compose exec cloudhal site-build), run by hand or from cron after a publish. Nothing rebuilds the site automatically when an editor or an agent publishes, so a self-hosted site can serve stale pages until someone runs the command.
Expected
A publish on a self-hosted installation refreshes the served site without an operator step:
A publish hook on the Node server (cloudhal studio): when a snapshot is published (the publish path in @cloudhal/core-ts / the API's publish route and RFC-0008's scheduled releases), schedule one cloudhal build run in a child process, debounced so a burst of publishes builds once, serialised so two builds never overlap, with the result (duration, snapshot id, failure) written to the audit log and visible in Studio.
The purge step that the Cloudflare site Worker has (onPublished + the release purger) is the natural seam; self-host should hang the build on the same event, so the two runtimes stay symmetrical.
Failure handling: a failed build keeps the previous dist (build into a temporary directory, swap atomically), reports in Studio and retries on the next publish.
A CLOUDHAL_SITE_BUILD=off escape hatch for installations that build elsewhere (CI, another host), and documentation in docs/guides/self-host.md replacing the manual site-build paragraph.
Not in scope
Live rendering of the site from the store on Node (an Astro Node adapter for starters/blog) is a separate RFC; this issue only closes the gap in option (a).
Activity
fix(cli): review round for site rebuild on publish (#150)
fix(cli): keep the publish swap whole and polling alive (#150)
fix(cli): capture the live build while streaming (#150)
Merge pull request #199 from cloudhal-dev/feat/self-host-rebuild-on-p…