Bucksley / website · bucksley.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/, 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. |
| 6 | set -euo pipefail |
| 7 | rm -rf dist && mkdir dist |
| 8 | for f in * ; do |
| 9 | case "$f" in dist|tools|functions|downloads|README.md) continue ;; esac |
| 10 | cp -R "$f" dist/ |
| 11 | done |
| 12 | cp _headers _redirects dist/ |
| 13 | node tools/indexnow.mjs dist/sitemap.xml dist --lastmod |