File tree Expand file tree Collapse file tree 3 files changed +17
-13
lines changed
Expand file tree Collapse file tree 3 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 1- name : Build & Push to ECR
1+ name : ' 💎 Deploy: Production ( ECR-Prod) '
22
33on :
44 push :
Original file line number Diff line number Diff line change @@ -5,17 +5,21 @@ PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
55
66cd " $PROJECT_DIR "
77
8- echo " 👉 Pull main "
9- git pull origin main
8+ # 定义文件路径变量
9+ COMPOSE_FILE= " docker-compose.dev.yml "
1010
11- echo " 👉 Fetch build"
12- git fetch origin build
11+ echo " 🚀 Starting deployment..."
1312
14- echo " 👉 Clean build artifacts"
15- rm -rf .next public
13+ # 1. 拉取最新镜像
14+ echo " 📥 Pulling latest images..."
15+ docker-compose -f $COMPOSE_FILE pull
1616
17- echo " 👉 Restore build artifacts"
18- git restore --source origin/build .next public
17+ # 2. 启动/更新容器
18+ echo " 🆙 Starting containers..."
19+ docker-compose -f $COMPOSE_FILE up -d
1920
20- echo " 👉 Start docker"
21- docker-compose up -d
21+ # 3. 清理旧镜像
22+ echo " 🧹 Cleaning up old images..."
23+ docker image prune -f
24+
25+ echo " ✅ Deployment completed successfully!"
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ echo "🚀 Starting deployment..."
1212
1313# 1. 拉取最新镜像
1414echo " 📥 Pulling latest images..."
15- docker compose -f $COMPOSE_FILE pull
15+ docker- compose -f $COMPOSE_FILE pull
1616
1717# 2. 启动/更新容器
1818echo " 🆙 Starting containers..."
19- docker compose -f $COMPOSE_FILE up -d
19+ docker- compose -f $COMPOSE_FILE up -d
2020
2121# 3. 清理旧镜像
2222echo " 🧹 Cleaning up old images..."
You can’t perform that action at this time.
0 commit comments