vinylgauntlet/deploy.sh
type-two a4ec2e7dd4 Deploy to partly.party/vinylgauntlet
Vite base=/vinylgauntlet/ and Phaser assets load from BASE_URL so they resolve
under the subpath. deploy.sh builds and ships dist/ into the forum-nginx
container (humanjing@100.71.119.27), same pattern as the other partly.party
games. Verified live: 200, game HTML + sprites serving, renders in-browser.

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

31 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Vinyl Gauntlet — deploy to partly.party/vinylgauntlet
# Build the Vite app, ship dist/ into the forum-nginx container.
# Requires: SSH humanjing@100.71.119.27 (tailscale), docker container forum-nginx.
set -euo pipefail
VPS="humanjing@100.71.119.27"
CONTAINER="forum-nginx"
WEB_ROOT="/usr/share/nginx/html/vinylgauntlet"
STAGING="/tmp/vinylgauntlet_deploy"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "[1/5] Building ..."
( cd "$SCRIPT_DIR" && npm run build >/dev/null )
echo " ✓ dist/ built"
echo "[2/5] Rsync dist/ -> VPS staging ..."
ssh "$VPS" "rm -rf '$STAGING' && mkdir -p '$STAGING'"
rsync -az --delete "$SCRIPT_DIR/dist/" "$VPS:$STAGING/"
echo "[3/5] Reset container web root ..."
ssh "$VPS" "docker exec $CONTAINER sh -c 'rm -rf ${WEB_ROOT:?} && mkdir -p ${WEB_ROOT:?}'"
echo "[4/5] Copy bundle into container ..."
ssh "$VPS" "docker cp $STAGING/. $CONTAINER:$WEB_ROOT/ && rm -rf '$STAGING'"
echo "[5/5] Verify ..."
code=$(curl -s -o /dev/null -w '%{http_code}' "https://partly.party/vinylgauntlet/?cb=$RANDOM")
echo " https://partly.party/vinylgauntlet/ -> $code"
[ "$code" = "200" ] && echo " ✓ live" || { echo " ✗ not 200 — check nginx routing"; exit 1; }