toastsim/scripts/deploy.sh
type-two 8f5641a57f Pieces render true to pattern: dice = chunk grid, wedges = exploded sectors
Dice show the criss-cross (drawn 1.6x true size — honest proportions
vanish against the board at game camera distance); wedges explode 0.28
from center so gaps and uneven angles read. Slices keep the fan. Plus
scripts/deploy.sh (partly.party/toastsim, cratewars pattern) — pending
an ssh permission grant to run the final docker cp step.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 15:13:21 +10:00

31 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# TOASTSIM — deploy to partly.party/toastsim (games VPS, forum-nginx pattern).
# ./scripts/deploy.sh
# Build with subpath base → rsync to VPS staging → docker cp into web root → curl verify.
set -euo pipefail
VPS="humanjing@100.71.119.27"
CONTAINER="forum-nginx"
REMOTE_WEB_ROOT="/usr/share/nginx/html/toastsim"
STAGING="/tmp/toastsim_deploy"
REPO="$(cd "$(dirname "$0")/.." && pwd)"
echo "[1/4] Building (base=/toastsim/)..."
cd "$REPO"
./node_modules/.bin/tsc --noEmit
./node_modules/.bin/vite build --base=/toastsim/
echo "[2/4] Rsync dist → $VPS:$STAGING ..."
ssh "$VPS" "rm -rf '$STAGING' && mkdir -p '$STAGING'"
rsync -az dist/ "$VPS:$STAGING/"
echo "[3/4] Swap into $CONTAINER:$REMOTE_WEB_ROOT ..."
ssh "$VPS" "docker exec '$CONTAINER' rm -rf '$REMOTE_WEB_ROOT' \
&& docker cp '$STAGING' '$CONTAINER:$REMOTE_WEB_ROOT'"
echo "[4/4] Verify..."
code=$(curl -so /dev/null -w '%{http_code}' "https://partly.party/toastsim/?cb=$(date +%s)")
echo "https://partly.party/toastsim/ → HTTP $code"
[ "$code" = 200 ] || { echo "NOT DEPLOYED (non-200)"; exit 1; }
echo "done."