Topic — Directus Flows x Cloudflare Pages automated deployment
Tools — Directus 11.x, Cloudflare Deploy Hook
Background
nuxt generate is static generation — data is baked into HTML at build time. After publishing a new article, the live site does not update automatically; a manual rebuild is required.
Solution: Directus Flow Triggering a Cloudflare Deploy Hook
Step 1: Create a Deploy Hook in Cloudflare Pages
- Cloudflare Dashboard → Pages →
guess-what-frontend - Settings → Build & deployments → Deploy hooks
- Add a hook, name it
directus, set the branch tomain - Copy the generated Hook URL
Step 2: Create a Flow in Directus
- Settings → Flows → Add new
- Trigger: Event Hook
- Scope:
items.create,items.update,items.delete - Collections:
posts
- Scope:
- Operation: Webhook / Request URL
- Method:
POST - URL: paste the Hook URL copied in Step 1
- Method:
- Enable the Flow
Result
Every time an article is added or modified in Directus, the Flow automatically sends a POST request to Cloudflare, triggering a rebuild. The live site updates approximately 1–2 minutes later.
