first commit

This commit is contained in:
dekun
2026-06-10 19:59:27 +08:00
commit d141623070
813 changed files with 61301 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# 知命阁(zhimingge)服务器更新脚本
# 用法:cd /opt/zhimingge && bash scripts/deploy.sh
set -euo pipefail
APP_DIR="/opt/zhimingge"
APP_NAME="zhimingge"
cd "$APP_DIR"
echo "==> 拉取最新代码..."
git pull origin main
echo "==> 安装依赖..."
pnpm install --frozen-lockfile
echo "==> 生产构建..."
pnpm run build
echo "==> 确保日志目录存在..."
mkdir -p logs
echo "==> 重启 PM2..."
pm2 restart "$APP_NAME" || pm2 start ecosystem.config.cjs
echo "==> 部署完成"
pm2 status "$APP_NAME"
curl -s -o /dev/null -w "HTTP %{http_code}\n" http://127.0.0.1:3000 || true