chore: 添加 gitea deploy workflow
Some checks failed
Deploy to Server / deploy (push) Has been cancelled
Some checks failed
Deploy to Server / deploy (push) Has been cancelled
This commit is contained in:
21
deploy.sh
Normal file
21
deploy.sh
Normal 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] 部署完成。"
|
||||
Reference in New Issue
Block a user