autobuild
What it does
On every content publish and delete, POSTs (or GETs) a deploy hook URL - typically a Cloudflare Pages, Netlify, or Vercel build webhook. Debounces rapid publishes so a batch of edits triggers one deploy, not ten. No UI, no companion component.
This is the plugin that makes plugdash.dev's core promise real - the admin becomes the thing that moves the site.
Install
npm install @plugdash/autobuildRegister
Open astro.config.mjs at the root of your Astro project. Import the plugin at the top, then add it to the pluginsarray of the emdash() integration - the one that sits inside Astro's top-level integrations array:
import { defineConfig } from "astro/config"
import emdash from "emdash/astro"
import { autobuildPlugin } from "@plugdash/autobuild"
export default defineConfig({
integrations: [
emdash({
plugins: [
autobuildPlugin({
hookUrl: import.meta.env.CF_PAGES_DEPLOY_HOOK,
allowedHosts: ["api.cloudflare.com"],
}),
],
}),
],
})Get the hook URL from your Cloudflare Pages project underSettings -> Builds & deployments -> Deploy hooks. Store it as CF_PAGES_DEPLOY_HOOK in the Pages dashboard environment variables (mark it encrypted).
How it fires
publish in admin -> hook fires -> deploy kicks off -> liveNo component
autobuild has no companion component. It is pure infrastructure.
Props
| prop | type | default | description |
|---|---|---|---|
method | "POST" | "GET" | "POST" | HTTP method for the hook |
collections | string[] | Which collections trigger rebuilds | |
statuses | string[] | ["published"] | Trigger only on these statuses |
debounceMs | number | 5000 | Debounce window for rapid publishes |
body | string | object | Optional request body | |
headers | object | Optional extra headers |
For agents
After install, the env var CF_PAGES_DEPLOY_HOOK must be set for the plugin to do anything. Gate registration on the env var being present - when it is missing, skip the plugin entirely. Verify by publishing a content edit in the admin and confirming a new build starts within the debounceMs window (default 5 seconds).