From d0e08a80b890cc7551c66e58d52082609bb0241f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 10:43:15 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B9=E5=96=84=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=AF=8A=E6=96=AD=E8=BE=93=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=20npm=20stderr=20=E9=9D=99=E9=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/deploy-to-server.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-to-server.yml b/.github/workflows/deploy-to-server.yml index 5baa4116..264092bd 100644 --- a/.github/workflows/deploy-to-server.yml +++ b/.github/workflows/deploy-to-server.yml @@ -213,7 +213,7 @@ jobs: if [ -f '${{ secrets.DEPLOY_PATH }}/backend/server.js' ]; then echo '📦 安装 backend 依赖...' cd '${{ secrets.DEPLOY_PATH }}/backend' - npm install --production 2>/dev/null || echo '⚠️ backend npm install 失败' + npm install --production || echo '⚠️ backend npm install 失败' echo '🔄 重启 backend 服务...' pm2 restart guanghulab-backend 2>/dev/null || \ pm2 start server.js --name guanghulab-backend 2>/dev/null || \ @@ -224,14 +224,14 @@ jobs: if [ -f '${{ secrets.DEPLOY_PATH }}/src/index.js' ]; then echo '📦 安装 src 依赖...' cd '${{ secrets.DEPLOY_PATH }}' - npm install --production 2>/dev/null || echo '⚠️ src npm install 失败' + npm install --production || echo '⚠️ src npm install 失败' echo '🔄 重启 HLI 服务...' pm2 restart guanghulab 2>/dev/null || \ pm2 start src/index.js --name guanghulab 2>/dev/null || \ echo '⚠️ src pm2 启动失败' fi - pm2 save 2>/dev/null || true + pm2 save || echo '⚠️ pm2 save 失败,重启后进程可能不会自动启动' echo '✅ 后端服务部署完成' " @@ -247,7 +247,8 @@ jobs: exit 0 fi - # 更新 root 路径(从旧的 status-board 子目录改为站点根目录) + # 一次性迁移:更新 root 路径(从旧的 status-board 子目录改为站点根目录) + # 迁移完成后此检查自动无操作 if grep -q 'root.*guanghulab/status-board' /etc/nginx/sites-available/default 2>/dev/null || \ grep -q 'root.*guanghulab/status-board' /etc/nginx/conf.d/*.conf 2>/dev/null; then echo '🔄 更新 Nginx root 路径...'