Skip to content

chobbledotcom/chobble-builder

Repository files navigation

Chobble Builder

Central build system for Chobble sites. Client repos push content; this repo merges it with the Chobble Template and deploys the static site.

Architecture

Client Repo (push)
    │
    ▼
Bunny Edge Script (webhook relay)
    │
    ▼
GitHub repository_dispatch → This Repo
    │
    ├── Pulls client content
    ├── Pulls template
    ├── Merges + builds (Eleventy)
    └── Deploys to Bunny Storage

Why this design?

  • Security: Build logic lives only in this repo — client users can't modify workflows
  • Multi-tenant: One builder serves many client sites
  • Edge relay: Bunny Edge Script validates webhooks before triggering builds

How It Works

1. Client pushes content

A client repo (e.g. chobble-client) pushes markdown, images, etc.

2. Webhook fires to Bunny Edge Script

GitHub sends a webhook to the Bunny Edge Script relay, which:

  • Validates the HMAC signature
  • Calls the GitHub API to trigger repository_dispatch on this repo

3. Sync & Build workflow runs

The sync-and-build.yml workflow:

  1. Checks out this builder repo
  2. Fetches the client repo content
  3. Fetches the Chobble Template
  4. Merges them via scripts/ci-merge.js
  5. Builds with Eleventy (via Bun)
  6. Deploys to Bunny Storage (staging or production based on branch)

Setup

Client Repo Configuration

Add a webhook in the client repo:

  • URL: Your Bunny Edge Script endpoint
  • Content type: application/json
  • Secret: Shared webhook secret (stored as WEBHOOK_SECRET in the edge script)
  • Events: Just the Push event

Bunny Edge Script Secrets

Deploy edge-script/webhook-relay.ts to Bunny Edge Scripting and set these secrets:

Secret Description
WEBHOOK_SECRET HMAC secret shared with client webhooks
WEBHOOK_SECRET_0 Additional client webhook secret (optional)
GITHUB_PAT GitHub PAT with repo scope on this builder repo
BUILDER_REPO This repo as owner/repo (e.g. chobbledotcom/chobble-builder)

GitHub Secrets (on this builder repo)

Secret Description
BUNNY_ACCESS_KEY Bunny CDN API access key
BUNNY_PRODUCTION_STORAGE_ZONE_NAME Production storage zone
BUNNY_PRODUCTION_STORAGE_ZONE_PASSWORD Production storage password
BUNNY_PRODUCTION_PULL_ZONE_ID Production pull zone ID
BUNNY_STAGING_STORAGE_ZONE_NAME Staging storage zone
BUNNY_STAGING_STORAGE_ZONE_PASSWORD Staging storage password
BUNNY_STAGING_PULL_ZONE_ID Staging pull zone ID
FORMSPARK_ID Formspark form ID (optional)
BOTPOISON_PUBLIC_KEY BotPoison public key (optional)
NTFY_TOPIC ntfy.sh notification topic (optional)

Local Development

For local builds you need the template available. Clone it alongside this repo:

git clone https://github.com/chobbledotcom/chobble-template ../chobble-template
bun install
bun run build

Or use the prepare-dev script which clones/updates the template automatically:

bun run prepare-dev
bun run build

Scripts

Script Purpose
scripts/ci-merge.js Merges template + client into combined directory
scripts/build.js Local build (prepares dev env + runs Eleventy)
scripts/prepare-dev.js Sets up local dev environment
scripts/sync-files.js Syncs changed files to dev build
scripts/watch.js Watches for file changes
scripts/serve.js Starts local dev server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors