From 47fc78057d34242b6354a764158b3c18f3fcd239 Mon Sep 17 00:00:00 2001 From: Christbru Date: Sat, 18 Oct 2025 21:37:47 -0500 Subject: [PATCH] Fix deployment: properly stop containers before recreating - Add compose down before pull/up to avoid container name conflicts - Improve toolchain caching: only install if not already present - Add log directory mount for easy error monitoring - Scope Buildx cache per image for better hit rates --- .github/workflows/build-and-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 42309e3..a45f109 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -96,7 +96,9 @@ jobs: export MYSQL_PASSWORD='${{ secrets.MYSQL_PASSWORD }}' export MYSQL_ROOT_PASSWORD='${{ secrets.MYSQL_ROOT_PASSWORD }}' export IMAGE_TAG=${{ github.sha }} + # Stop and remove old containers before pulling new images + compose -f docker-compose.prod.yml down compose -f docker-compose.prod.yml pull - compose -f docker-compose.prod.yml up -d --force-recreate + compose -f docker-compose.prod.yml up -d # Security hygiene: remove GHCR credentials after pulling docker logout ghcr.io || true \ No newline at end of file