feat: add git pull

This commit is contained in:
fuzhongyun 2025-12-29 16:47:12 +08:00
parent 80d3ffa0e7
commit e8862d2cb6
1 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,14 @@ PORT=8000
echo "开始部署 $IMAGE_NAME ..." echo "开始部署 $IMAGE_NAME ..."
# 0. 拉取最新代码
if [ -d ".git" ]; then
echo "正在拉取最新代码..."
git pull
else
echo "警告: 当前不是 Git 仓库,跳过代码拉取。"
fi
# 1. 构建 Docker 镜像 # 1. 构建 Docker 镜像
echo "构建 Docker 镜像..." echo "构建 Docker 镜像..."
docker build -t $IMAGE_NAME:latest . docker build -t $IMAGE_NAME:latest .