#!/usr/bin/env bash # deploy-web.sh — build and push the web UI to the VPS. # Assumes SSH agent forwarding is set up. # # SETUP: copy this file to deploy-web.sh (gitignored) and set HOST below. # # Usage: # ./deploy-web.sh # # Optional env vars: # HOST SSH target (user@host) (required — edit below) # REMOTE_DIR path on VPS (default: ~/waste-www) set -euo pipefail HOST="${HOST:-user@YOUR_VPS_IP}" # ← edit this REMOTE_DIR="${REMOTE_DIR:-~/waste-www}" if [[ "$HOST" == *YOUR_VPS_IP* ]]; then echo "error: edit HOST in this script (or export HOST=user@your-vps before running)" >&2 exit 1 fi echo "→ building web UI…" "$(dirname "$0")/build-web.sh" echo "→ syncing to $HOST:$REMOTE_DIR" rsync -azv --delete \ --exclude='config.js' \ web/dist/ "$HOST:$REMOTE_DIR/" echo "✓ done"