ops: 专用聊天服务重启 workflow
独立 workflow 仅触发 portal 重启,不影响其他部署流程。
This commit is contained in:
parent
d4736117c0
commit
78ea852ed9
35
.gitea/workflows/restart-chat.yaml
Normal file
35
.gitea/workflows/restart-chat.yaml
Normal file
@ -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 服务已尝试重启"
|
||||
0
.runtime/restart-chat-trigger
Normal file
0
.runtime/restart-chat-trigger
Normal file
Loading…
x
Reference in New Issue
Block a user