-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·27 lines (20 loc) · 794 Bytes
/
deploy.sh
File metadata and controls
executable file
·27 lines (20 loc) · 794 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
#!/bin/bash
# Deploy docs directly to Cloudflare Pages from a local source directory.
# Usage: ./deploy.sh <source-docs-dir>
# Example: ./deploy.sh ~/repos/my-private-docs
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SOURCE_DIR="${1:?Usage: ./deploy.sh <source-docs-dir>}"
OUTPUT_DIR="$SCRIPT_DIR/_site"
if [ ! -d "$SOURCE_DIR" ]; then
echo "Error: $SOURCE_DIR does not exist"
exit 1
fi
echo "==> Installing build dependencies..."
pip install -q -r "$SCRIPT_DIR/build/requirements.txt"
echo "==> Building site from $SOURCE_DIR..."
rm -rf "$OUTPUT_DIR"
python "$SCRIPT_DIR/build/build.py" "$SOURCE_DIR" "$OUTPUT_DIR"
echo "==> Deploying to Cloudflare Pages..."
npx wrangler pages deploy "$OUTPUT_DIR" --project-name=private-doc-viewer
echo "==> Done! Site deployed."