chore: 添加 gitea deploy workflow
Some checks failed
Deploy to Server / deploy (push) Has been cancelled

This commit is contained in:
lzh
2026-01-27 17:55:24 +08:00
parent 842998893a
commit 821dfbe0f1
2 changed files with 37 additions and 0 deletions

21
deploy.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e
APP_DIR="/opt/apps/vitals"
BRANCH="main"
echo "[deploy] 切换到部署目录: ${APP_DIR}"
cd "${APP_DIR}"
echo "[deploy] 更新代码..."
git fetch origin
git checkout "${BRANCH}"
git pull origin "${BRANCH}"
echo "[deploy] 使用 docker compose 构建并部署..."
docker compose --env-file .env.production \
-f docker-compose.yml \
-f docker-compose.prod.yml \
up -d --build
echo "[deploy] 部署完成。"