#!/usr/bin/env bash # build the ball pit, assemble it under /top, and deploy to Cloudflare Pages. # layout served: bisk.social/ -> placeholder/index.html # bisk.social/top -> the app (vite build, base ./) # the snapshot is fetched cross-origin from R2 (CORS-allowed for bisk.social). # # needs: CLOUDFLARE_API_TOKEN (Pages edit) + CLOUDFLARE_ACCOUNT_ID set -euo pipefail cd "$(dirname "$0")/.." bun run build rm -rf deploy mkdir -p deploy/top cp -R dist/. deploy/top/ cp placeholder/index.html deploy/index.html # Pages Functions (/og-image card, /top/market proxy, /top/recommend); # wrangler bundles node deps. drop test files — they aren't routes and pull in vitest. cp -R functions deploy/functions rm -f deploy/functions/*.test.js bunx wrangler@latest pages deploy deploy \ --project-name=bisk --branch=main --commit-dirty=true