# Rebuild a static site when an editor publishes in Easy CMS

> Point an Easy CMS webhook at your host's deploy hook to rebuild only on publish, with signed requests and a day of retries.

URL: https://easycms.dev/blog/rebuild-a-static-site-when-an-editor-publishes  
Published: 2026-09-17  
Updated: 2026-10-29

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

```ts
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.
