-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·28 lines (21 loc) · 1008 Bytes
/
deploy.sh
File metadata and controls
executable file
·28 lines (21 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
# Deploy tools to Cloudflare Pages (personal account)
set -euo pipefail
cd "$(dirname "$0")"
export CLOUDFLARE_API_TOKEN=$(pass show claude/api/cloudflare-full)
export CLOUDFLARE_ACCOUNT_ID="3d4b1d36109e30866bb7516502224b2c"
COMMIT_MSG=$(git log -1 --format="%h %s" 2>/dev/null || echo "manual deploy")
echo "Deploying tools..."
echo "Commit: $COMMIT_MSG"
# Stage to a temp directory, excluding files over 25MB (Cloudflare Pages limit)
STAGING=$(mktemp -d)
trap "rm -rf $STAGING" EXIT
echo "Staging files (excluding >25MB)..."
rsync -a --exclude='.git' --max-size=25M . "$STAGING/"
# Clear wrangler account cache (prevents cross-account contamination)
rm -f "$HOME/node_modules/.cache/wrangler/wrangler-account.json" "$HOME/node_modules/.cache/wrangler/pages.json" 2>/dev/null
npx wrangler pages deploy "$STAGING/resource-kit/docs" \
--project-name=tools-pages \
--branch=master \
--commit-message="$COMMIT_MSG" --commit-dirty=true
echo "Done: https://tools-pages.pages.dev"