Rebuild a static site when an editor publishes
Point a webhook at your host's deploy hook and the site rebuilds when content goes live, and only then.
A site generated at build time (Astro, Nuxt generate, a Next.js export, Hugo) can rebuild by itself when content is published.
1. Get a deploy hook
Netlify, Vercel and Cloudflare Pages each give you a URL that starts a build when it receives a POST. Keep it in an environment variable.
2. Call it when something goes live
webhooks: [
{
url: process.env.DEPLOY_HOOK_URL as string,
events: ['publish', 'unpublish', 'delete'],
collections: ['posts', 'pages'],
},
],Only changes visitors can see start a build, not every draft save. For collections without drafts, add update and create.
Reliable delivery
Easy CMS sends the request after the change is saved and retries for about a day if the host is down, even across restarts. Every request is signed, so a receiver of your own can check it came from your CMS. Scheduled publishing sends publish too, so a post set for 9:00 rebuilds the site at 9:00.
The recipe Rebuild a static site on publish in the docs has the details.