From a4ec2e7dd49d53d0fcd6b8e268f14094895bfc9a Mon Sep 17 00:00:00 2001 From: type-two Date: Wed, 15 Jul 2026 00:08:27 +1000 Subject: [PATCH] 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 --- deploy.sh | 30 ++++++++++++++++++++++++++++++ src/GameScene.js | 4 +++- vite.config.js | 6 ++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 deploy.sh create mode 100644 vite.config.js diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..f0af8a8 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,30 @@ +#!/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; } diff --git a/src/GameScene.js b/src/GameScene.js index a5e0e04..040785e 100644 --- a/src/GameScene.js +++ b/src/GameScene.js @@ -33,7 +33,9 @@ export default class GameScene extends Phaser.Scene { } preload() { - for (const key of TEXTURE_KEYS) this.load.image(key, `sprites/${key}.png`); + // BASE_URL makes assets resolve under the deploy subpath (partly.party/vinylgauntlet/) + const base = import.meta.env.BASE_URL; + for (const key of TEXTURE_KEYS) this.load.image(key, `${base}sprites/${key}.png`); } create() { diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..cd36beb --- /dev/null +++ b/vite.config.js @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite'; + +// Served from a subpath on partly.party, so assets must resolve under /vinylgauntlet/. +export default defineConfig({ + base: '/vinylgauntlet/', +});