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>
This commit is contained in:
parent
8341bed22f
commit
a4ec2e7dd4
30
deploy.sh
Normal file
30
deploy.sh
Normal file
@ -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; }
|
||||||
@ -33,7 +33,9 @@ export default class GameScene extends Phaser.Scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
preload() {
|
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() {
|
create() {
|
||||||
|
|||||||
6
vite.config.js
Normal file
6
vite.config.js
Normal file
@ -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/',
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user