From 78ea852ed984e9d0ba540275acd98bd4b3bdc6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=91=E5=A9=B7=E9=99=88?= Date: Tue, 26 May 2026 14:03:28 +0800 Subject: [PATCH] =?UTF-8?q?ops:=20=E4=B8=93=E7=94=A8=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=87=8D=E5=90=AF=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 独立 workflow 仅触发 portal 重启,不影响其他部署流程。 --- .gitea/workflows/restart-chat.yaml | 35 ++++++++++++++++++++++++++++++ .runtime/restart-chat-trigger | 0 2 files changed, 35 insertions(+) create mode 100644 .gitea/workflows/restart-chat.yaml create mode 100644 .runtime/restart-chat-trigger diff --git a/.gitea/workflows/restart-chat.yaml b/.gitea/workflows/restart-chat.yaml new file mode 100644 index 0000000..fff771c --- /dev/null +++ b/.gitea/workflows/restart-chat.yaml @@ -0,0 +1,35 @@ +name: 重启聊天服务 + +on: + push: + paths: + - '.runtime/restart-chat-trigger' + +jobs: + restart: + runs-on: ubuntu + steps: + - name: 重启 Portal 聊天服务 + run: | + echo "═══ 重启 Portal ═══" + if pm2 describe guanghulab-portal > /dev/null 2>&1; then + pm2 restart guanghulab-portal + echo "✅ guanghulab-portal 已重启" + else + echo "⚠️ guanghulab-portal 未在 PM2 中注册" + fi + + echo "═══ PM2 状态 ═══" + pm2 list || true + + echo "═══ 验证 ═══" + sleep 3 + if curl -sf http://127.0.0.1:3000/ > /dev/null 2>&1; then + echo "✅ Portal 端口 3000 正常" + else + echo "❌ Portal 端口 3000 未响应" + fi + + # 尝试重启所有 PM2 服务 + pm2 restart all 2>/dev/null || true + echo "✅ 所有 PM2 服务已尝试重启" diff --git a/.runtime/restart-chat-trigger b/.runtime/restart-chat-trigger new file mode 100644 index 0000000..e69de29