From ae60037708bb03bd38b0e2faed040a0c3f77024c Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 21 Jan 2026 17:13:34 +0100 Subject: [PATCH] deploy --- .gitea/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a073ac1a..2ad9190d 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -89,17 +89,36 @@ jobs: echo '=== Logging into Docker registry ===' echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin - echo '✓ Registry login successful' + if [ $? -eq 0 ]; then + echo '✓ Registry login successful' + else + echo '✗ Registry login failed' + exit 1 + fi echo '=== Checking current containers ===' docker compose ps - + + echo '=== Checking current image ===' + docker images registry.infra.mintel.me/mintel/klz-cables.com:latest + + echo '=== Removing local image to force fresh pull ===' + docker rmi registry.infra.mintel.me/mintel/klz-cables.com:latest || true + echo '=== Pulling latest image ===' docker compose pull - echo '✓ Image pulled successfully' - - echo '=== Verifying new image ===' + echo '✓ Image pull command completed' + + echo '=== Verifying new image after pull ===' docker images registry.infra.mintel.me/mintel/klz-cables.com:latest + + echo '=== Checking if image was actually updated ===' + if docker inspect registry.infra.mintel.me/mintel/klz-cables.com:latest >/dev/null 2>&1; then + echo '✓ Image exists locally' + else + echo '✗ Image pull failed - image not found locally' + exit 1 + fi echo '=== Stopping all containers ===' docker compose down @@ -120,11 +139,22 @@ jobs: echo '=== Checking varnish container logs ===' docker compose logs --tail=20 varnish - + + echo '=== Verifying application health ===' + # Wait a bit more for the app to be fully ready + sleep 10 + if curl -f -s http://localhost:80/health > /dev/null 2>&1; then + echo '✓ Application health check passed' + else + echo '✗ Application health check failed - checking app logs' + docker compose logs --tail=50 app + exit 1 + fi + echo '=== Cleaning up old images ===' docker image prune -f --filter 'until=24h' - + echo '=== Deployment completed successfully ===' " - + echo "Deployment completed" \ No newline at end of file