Skip to content

Commit 79c07df

Browse files
committed
fix: clean up old docker files before extraction
1 parent 94cc205 commit 79c07df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/deploy-vps.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,21 @@ jobs:
9191
ls -t /tmp/backup-*.tar.gz 2>/dev/null | tail -n +6 | xargs -r rm
9292
fi
9393
94+
# Stop and remove old containers
95+
echo "🛑 Stopping old containers..."
96+
docker compose down --remove-orphans || true
97+
98+
# Clean up old files (keep data volumes)
99+
echo "🧹 Cleaning up old files..."
100+
rm -f docker-compose.yml Dockerfile Dockerfile.* 2>/dev/null || true
101+
94102
# Extract new deployment
95103
echo "📂 Extracting new files..."
96104
tar -xzf /tmp/deploy-vps.tar.gz
97105
rm /tmp/deploy-vps.tar.gz
98106
99107
# Rebuild and restart containers
100108
echo "🐳 Rebuilding Docker containers..."
101-
docker compose down --remove-orphans || true
102109
docker compose up --build -d
103110
104111
# Wait for services to be healthy

0 commit comments

Comments
 (0)