diff --git a/scripts/deploy-to-target.sh b/scripts/deploy-to-target.sh index 15d4dd51..f5ceaf6e 100755 --- a/scripts/deploy-to-target.sh +++ b/scripts/deploy-to-target.sh @@ -154,14 +154,10 @@ if [ "$LIVE" = true ]; then # Build and deploy AIUI (non-fatal — never delete existing AIUI on failure) AIUI_DIR="$PROJECT_DIR/../AIUI" AIUI_DIST="$AIUI_DIR/packages/app/dist" - if [ -d "$AIUI_DIR/packages/app" ]; then - echo "$(timestamp) Building AIUI for /aiui/ base path..." - AIUI_BUILD_OK=false - if (cd "$AIUI_DIR" && VITE_BASE_PATH=/aiui/ pnpm build 2>&1 | tail -10); then - AIUI_BUILD_OK=true - fi - cd "$PROJECT_DIR" - if [ "$AIUI_BUILD_OK" = true ] && [ -d "$AIUI_DIST" ] && [ -f "$AIUI_DIST/index.html" ]; then + if [ -d "$AIUI_DIST" ] && [ -f "$AIUI_DIST/index.html" ]; then + # Use pre-built AIUI dist (build with: cd ../AIUI && VITE_BASE_PATH=/aiui/ pnpm build) + echo "$(timestamp) Using pre-built AIUI dist..." + if true; then echo "$(timestamp) Deploying AIUI..." ssh $SSH_OPTS "$TARGET_HOST" "sudo mkdir -p /opt/archipelago/web-ui/aiui" ssh $SSH_OPTS "$TARGET_HOST" "sudo rm -rf /opt/archipelago/web-ui/aiui/*"