feat(deploy): snapshot vor svelte-build im deploy-skript

Damit DEPLOY_TARGET=svelte/staging/prod immer mit aktuellem
snapshot/output baut. Ohne diesen step wuerde ein veralteter
snapshot ins HTML wandern, frische posts oder uebersetzungen
saessen erst beim naechsten deploy drin.

Schlaegt der snapshot fehl (relays down, env fehlt), bricht das
skript ab — bewusst hard-fail, damit kein verfaelschter build
hochgeladen wird.

Live-verifiziert auf https://svelte.joerg-lohrer.de/bibel-selfies/:
- HTTP 200, og-tags + hreflang + json-ld korrekt
- __SITE_URL__-substitution greift sauber
- <title>, og:title, json-ld stimmen mit snapshot ueberein

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jörg Lohrer 2026-04-28 08:55:53 +02:00
parent 3e31caacef
commit f6824019c8
1 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,18 @@ for pair in "$FTP_HOST_KEY:$FTP_HOST" "$FTP_USER_KEY:$FTP_USER" \
done
BUILD_DIR="$ROOT/app/build"
SNAPSHOT_DIR="$ROOT/snapshot/output"
echo "Ziehe Snapshot von Relays …"
(cd "$ROOT/snapshot" && deno task snapshot) || {
echo "FEHLER: Snapshot fehlgeschlagen. 'cd snapshot && deno task snapshot' manuell ausführen zum Debuggen." >&2
exit 1
}
if [ ! -f "$SNAPSHOT_DIR/index.json" ]; then
echo "FEHLER: $SNAPSHOT_DIR/index.json fehlt nach snapshot." >&2
exit 1
fi
echo "Baue SvelteKit …"
(cd "$ROOT/app" && npm run build >/dev/null 2>&1) || {