--- name: com-local-build-deploy description: >- Deploy nomadro.com (US VPS) by building Next + admin locally, then uploading artifacts. Use when the user asks to 部署 / 上线 / deploy .com, or when remote VPS CPU is too weak for next build. Never rebuild Next on the US server. --- # .com 本地构建再部署(强制) ## 铁律 **性能不够就本地构建。** 美国机只接收已构建产物,**禁止**在 `108.174.50.68` 上跑 `pnpm exec next build` / `next build`。 默认发版目标:`nomadro.com`(美国 VPS)。未点名 `.cn` / 82 时不要发中国机。 ## 步骤(按序) 1. **本地构建(Windows 仓根)** ```powershell pnpm build pnpm build:admin-com ``` 确认存在: - `.next/BUILD_ID` - `apps/com/admin/dist/index.html` 2. **发版脚本**(打包 `.next` + admin dist + API/social 增量源码): ```powershell python scripts/deploy_platform_upgrade_com.py ``` - 目标:门户 `/var/www/nomadro.cn`(机器是美国,路径历史名)、`admin.nomadro.com`、`nomadmini-api`、`nomadro-social` - 带备份与失败回滚 3. **冒烟** - `https://nomadro.com/` - `https://nomadro.com/social/places` - `https://admin.nomadro.com/` - API health(脚本内已 curl) ## 反模式 - SSH 上美国机 `pnpm build` / `next build`(慢、易 OOM、易挂死) - 只改源码不重建本地 `.next` 就上传 - 默认 `deploy_*_82.py` 却对用户说「.com 已上线」 ## 相关 - 双站顺序:`.cursor/rules/com-first-deploy.mdc` - 上传连接:`apps/admin/deploy/_upload_next_us.py`(`connect()`) - 仅门户包:可参考 `_upload_next_us.py`,完整栈仍用 `deploy_platform_upgrade_com.py`