nginx-waste.conf: serve web/dist/ at root, proxy /ws to anchor (port 8080), SPA fallback for clean invite URLs, immutable cache for assets. deploy-web.sh: build + rsync to anchor host, skip config.js so the host's runtime config is not clobbered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
792 B
Bash
Executable File
30 lines
792 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deploy the web UI to the anchor host.
|
|
# Usage: ./deploy/deploy-web.sh [user@host]
|
|
#
|
|
# Builds web/dist/, syncs it to /var/www/waste-web/ on the anchor host,
|
|
# then reloads nginx. The anchor binary and config.js are left untouched.
|
|
|
|
set -euo pipefail
|
|
|
|
HOST="${1:-root@waste.dev.xplwd.com}"
|
|
REMOTE_WEB="/var/www/waste-web"
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
echo "→ Building web UI…"
|
|
cd "$REPO_ROOT/web"
|
|
npm ci --silent
|
|
npm run build
|
|
|
|
echo "→ Syncing dist/ to $HOST:$REMOTE_WEB/"
|
|
rsync -az --delete \
|
|
--exclude='config.js' \
|
|
"$REPO_ROOT/web/dist/" \
|
|
"$HOST:$REMOTE_WEB/"
|
|
|
|
echo "→ Reloading nginx…"
|
|
ssh "$HOST" "nginx -t && systemctl reload nginx"
|
|
|
|
echo "✓ Deployed to https://waste.dev.xplwd.com"
|