Branchwell

Jobley / website · jobley.ai / tools / cf-build.sh

1#!/usr/bin/env bash
2# Cloudflare Pages build: copies the deployable site into dist/ (everything except tools/,
3# functions/, src/, migrations/, test/, downloads/, package files, README and dotfiles), then runs
4# IndexNow against the built sitemap. functions/ stays at the repository root, where Pages finds it
5# and bundles it with src/. Native installer artifacts are not part of this build.
6set -euo pipefail
7python3 tools/build-site.py --community-pages
8rm -rf dist && mkdir dist
9for f in * ; do
10 case "$f" in dist|tools|functions|src|migrations|test|downloads|node_modules|package.json|package-lock.json|wrangler.toml|README.md|LICENSE) continue ;; esac
11 cp -R "$f" dist/
12done
13cp _headers _redirects _routes.json dist/
14node tools/indexnow.mjs dist/sitemap.xml dist --lastmod