Branchwell

Bucksley / website · bucksley.ai / tools / cf-build.sh

Raw 625 B on 952201df3fde9cc0b54225f5d6f982a40f060aaa
1#!/usr/bin/env bash
2# Cloudflare Pages build: copies the deployable site into dist/ (everything except tools/,
3# functions/, downloads/, README and dotfiles), then runs IndexNow against the built sitemap.
4# Installers are not deployed from the repo: /downloads/* streams from the R2 bucket bound as
5# DOWNLOADS (functions/_middleware.js), so Pages' 25 MiB file limit never applies.
6set -euo pipefail
7rm -rf dist && mkdir dist
8for f in * ; do
9 case "$f" in dist|tools|functions|downloads|README.md) continue ;; esac
10 cp -R "$f" dist/
11done
12cp _headers _redirects dist/
13node tools/indexnow.mjs dist/sitemap.xml dist --lastmod