@plugdash/autobuild

Pure infrastructure

Publish in the admin. Live in 60 seconds.

320 words·2min read

Fires your Cloudflare Pages, Netlify, or Vercel build hook on every publish. No git push. No manual redeploy. The admin becomes the thing that moves the site.

npm install @plugdash/autobuild
betaGitHub
js
import autobuild from "@plugdash/autobuild"
// in emdash plugins array:
autobuild({
  hookUrl: import.meta.env.CF_PAGES_DEPLOY_HOOK,
  allowedHosts: ["api.cloudflare.com"],
})
publish in admin->hook fires->deploy kicks off->live

No UI. Pure infrastructure.

Setup

  1. Install and register

    bash
    npm install @plugdash/autobuild
    js
    import autobuild from "@plugdash/autobuild"
    // in emdash plugins array:
    autobuild({
      hookUrl: import.meta.env.CF_PAGES_DEPLOY_HOOK,
      allowedHosts: ["api.cloudflare.com"],
    })

Get your build hook URL from Cloudflare Pages, Netlify, or Vercel. Paste it as an env var. After this, every publish rebuilds the site. Debounces 5 seconds so a batch of publishes triggers one deploy, not ten.

It looks right. But it's yours to change.

Config options

optiontypedefaultdescription
method"POST" | "GET""POST"HTTP method for the hook
collectionsstring[]Which collections trigger rebuilds
statusesstring[]["published"]Trigger only on these statuses
debounceMsnumber5000Debounce window for rapid publishes
bodystring | objectOptional request body
headersobjectOptional extra headers

Pairs well with

these write metadata on publish. autobuild makes sure the live site sees the new metadata within a minute.

beta

Readers decide in three seconds. Give them a reason to stay.

npm install @plugdash/readtime
beta

Long posts deserve navigation. Your readers will find what they came for.

npm install @plugdash/tocgen
built with plugdash.dev