| name | deploy |
| description | Deploy the joost-blog site. Regenerates the NLWeb search index (including embeddings), commits changes, and pushes to trigger a Cloudflare Pages deploy. |
| user_invocable | true |
Deploy
Deploys the joost-blog site to Cloudflare Pages.
What it does
- Fetches YouTube transcripts for any new videos (
scripts/fetch-transcripts.mjs)
- Uses cached transcripts when the file already exists
- Requires
yt-dlp on PATH (install via brew install yt-dlp)
- Regenerates the NLWeb search index (
scripts/generate-nlweb-index.mjs)
- Scans all blog posts, pages, and videos
- Skips draft content
- Appends each video's transcript to its search body
- Generates embeddings for new/changed content via Cloudflare API
- Uses cached embeddings for unchanged content
- Stages the updated index + any new transcript files
- Commits with a descriptive message
- Pushes to origin, triggering the Cloudflare Pages deploy
Steps
- Run
node scripts/fetch-transcripts.mjs and show the output to the user
- Run
node --env-file-if-exists=.env scripts/generate-nlweb-index.mjs and show the output
- Check what changed under
src/generated/ with git status --short src/generated/
- Stage:
git add src/generated/nlweb-index.json src/generated/nlweb-index.mjs src/generated/embedding-cache.json src/generated/transcripts/ (plus any other staged content the user is shipping)
- Run
git status to show the user what will be deployed
- Ask the user for a commit message (suggest one based on what changed)
- Commit and push to origin
- Confirm the deploy was triggered
Notes
- The
CF_API_TOKEN and CF_ACCOUNT_ID environment variables must be available for embedding generation; they live in .env. Pass --env-file-if-exists=.env to Node so the script picks them up.
- The prebuild step was removed from package.json — the index must be regenerated locally before deploying.
- If only code changes (no content changes), the index regeneration will show "0 to generate" and the cached index is reused.
fetch-transcripts.mjs is a no-op for videos that already have a cached transcript, so it's safe to run on every deploy.