Skip to content
Early bird + Black Friday · 73% off

Get ZeroDirs for $179 $49

Claim $49 deal

Publishing on approval

An approved listing gets a page only after the site rebuilds. providers.rebuild picks what asks for that build; providers.rebuildAuto whether approving asks by itself.

Match your deploy route.

  1. Cloudflare → Workers & Pages → your Worker → Settings → Build → Deploy hooks → Create deploy hook, on a repository already connected to Workers Builds.

  2. Store the URL.

    Terminal
    pnpm cf:secrets DEPLOY_HOOK_URL

    The value comes from .env.prod; the summary ends with set now: DEPLOY_HOOK_URL.

  3. Switch the provider on, run pnpm check:config, push.

    site.config.ts
    providers: { rebuild: 'deploy-hook', rebuildAuto: true },

Approve one listing in /admin/; the submitter’s page then says “goes live with the next publish”, the mail “within a few minutes”.

What to check Where You should see
The request the /admin/ publishing bar Last request: requested via deploy-hook on <date> — build_uuid <id>, or repository_dispatch "rebuild" accepted by <owner/repo>
The row pnpm exec wrangler d1 execute DB --remote --command "SELECT provider, status, detail FROM rebuild_requests ORDER BY created_at DESC LIMIT 1" requested, or coalesced when a build was in flight
The build Workers & Pages → Builds, or the Actions run [zerodirs-d1] D1 (remote): … in its log
The page curl -sI https://<your domain>/<listingBase>/<slug>/ | head -1 HTTP/2 200 once the build finishes
  • A builder needs all three D1 credentials. With a partial set the build fails naming the rest; with none it has no local database to fall back to and stops on listings loader: the local database has no listings table. Either way the previous deploy stays live — no build goes green with the page a 404.
  • Approving asks for a build (approve:<id>); so do editing, featuring or unfeaturing, the hourly expireFeatured job (featured-expired) and Publish now (manual). Rejecting never does.
  • The hourly retryRebuilds job refires the oldest failed row with fewer than five attempts: 429, 5xx, timeouts and transport errors count as retryable; 404, other 4xx, GitHub 401/403/422 do not — but a row is rescanned until its attempts run out either way. After five, only Publish now or pnpm deploy moves it.
  • rebuildAuto: false holds every request for Publish now, which fires one build.
State Visitor sees /admin/ reports Fix
rebuild: 'none' listings stay off the site warning; rows skipped pnpm deploy, or a provider
'deploy-hook' without DEPLOY_HOOK_URL the same error: “Approvals will not trigger a build.” pnpm cf:secrets DEPLOY_HOOK_URL
'github-dispatch' missing a secret the same error: falls back to none pnpm cf:secrets GITHUB_TOKEN GITHUB_REPO
USE_GITHUB_DEPLOY unset dispatch accepted, run skipped requested, no build gh variable set USE_GITHUB_DEPLOY --body true
The hook was deleted nothing builds failed — HTTP 404: the deploy hook no longer exists create a new hook, store it
a D1 credential missing on the builder the previous deploy requested, build failed: … is set but D1_READ_TOKEN is not set add it
no D1 credentials on the builder the previous deploy requested, build failed: the local database has no listings table add all three

providers.rebuild and providers.rebuildAuto — providers. 'deploy-hook' POSTs DEPLOY_HOOK_URL, 'github-dispatch' posts to GITHUB_REPO with GITHUB_TOKEN, and 'none' records the request and skips it.

  • Directorysrc/
    • Directoryserver/
      • Directoryrebuild/
        • index.ts requestRebuild(), the coalescing window, the row
        • deploy-hook.ts
        • github-dispatch.ts
        • none.ts
      • jobs.ts retryRebuilds
      • queries.ts the approve, update and feature queries
    • components/admin/RebuildBar.astro
    • loaders/index.ts which database the build reads
  • .github/workflows/deploy.yml the rebuild listener
  • .env.example the dashboard path, the token instructions