perf(falukant): deploy prebuilt models and release WebGL contexts
All checks were successful
Deploy to production / deploy (push) Successful in 2m19s
All checks were successful
Deploy to production / deploy (push) Successful in 2m19s
This commit is contained in:
@@ -60,8 +60,8 @@ if [ ! -f "$MODELS_MANIFEST" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Source GLBs are versioned in their own Git-LFS repository. Keep them outside
|
||||
# the application worktree, because update.sh removes untracked files there.
|
||||
# Deployment-ready GLBs are versioned in their own Git-LFS repository. Source
|
||||
# GLBs stay out of the deployment entirely and are optimized before publishing.
|
||||
# shellcheck disable=SC1090
|
||||
source "$MODELS_MANIFEST"
|
||||
: "${FALUKANT_MODELS_REPOSITORY:?Falukant models repository is missing}"
|
||||
@@ -79,30 +79,18 @@ echo "Lade Falukant-3D-Modelle aus ${FALUKANT_MODELS_REPOSITORY}@${FALUKANT_MODE
|
||||
rm -rf "$ASSETS_DIR"
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 --branch "$FALUKANT_MODELS_REF" \
|
||||
"$FALUKANT_MODELS_REPOSITORY" "$ASSETS_DIR"
|
||||
git -C "$ASSETS_DIR" lfs pull
|
||||
git -C "$ASSETS_DIR" lfs pull --include="public/models/3d/falukant/**"
|
||||
|
||||
ASSET_MODELS_DIR="$ASSETS_DIR/models-src/3d/falukant"
|
||||
if [ ! -d "$ASSET_MODELS_DIR/characters" ]; then
|
||||
# Keep deployments available while the dedicated LFS repository is being
|
||||
# populated. The active slot has already been built with these sources,
|
||||
# so it is a safe, read-only fallback for the new inactive slot.
|
||||
FALLBACK_MODELS_DIR="$CURRENT_FRONTEND/models-src/3d/falukant"
|
||||
if [ -d "$FALLBACK_MODELS_DIR/characters" ]; then
|
||||
echo "WARN: Falukant models are missing from ${FALUKANT_MODELS_REPOSITORY}@${FALUKANT_MODELS_REF}; nutze Modelle aus dem aktiven Slot." >&2
|
||||
ASSET_MODELS_DIR="$FALLBACK_MODELS_DIR"
|
||||
else
|
||||
echo "ERROR: Falukant models are missing from ${FALUKANT_MODELS_REPOSITORY}@${FALUKANT_MODELS_REF} and from the active slot" >&2
|
||||
exit 1
|
||||
fi
|
||||
ASSET_RUNTIME_MODELS_DIR="$ASSETS_DIR/public/models/3d/falukant"
|
||||
if [ ! -f "$ASSET_RUNTIME_MODELS_DIR/characters/female_opt.glb" ] || [ ! -f "$ASSET_RUNTIME_MODELS_DIR/houses/under_bridge_opt.glb" ]; then
|
||||
echo "ERROR: Optimized Falukant runtime models are missing from ${FALUKANT_MODELS_REPOSITORY}@${FALUKANT_MODELS_REF}. Run: npm --prefix frontend run build-runtime-models -- --assets-dir <asset-repository>." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Übernehme Falukant-3D-Quellmodelle..."
|
||||
rm -rf "$FRONTEND_DIR/models-src/3d/falukant"
|
||||
mkdir -p "$FRONTEND_DIR/models-src/3d"
|
||||
cp -a "$ASSET_MODELS_DIR" "$FRONTEND_DIR/models-src/3d/"
|
||||
|
||||
echo "Optimiere Falukant-3D-Modelle..."
|
||||
npm run optimize-models
|
||||
echo "Übernehme voroptimierte Falukant-3D-Modelle..."
|
||||
rm -rf "$FRONTEND_DIR/public/models/3d/falukant"
|
||||
mkdir -p "$FRONTEND_DIR/public/models/3d"
|
||||
cp -a "$ASSET_RUNTIME_MODELS_DIR" "$FRONTEND_DIR/public/models/3d/"
|
||||
|
||||
echo "Baue Frontend..."
|
||||
npm run build
|
||||
|
||||
Reference in New Issue
Block a user