fix: deploy

This commit is contained in:
2026-02-10 17:25:57 +01:00
parent ef0ea9b66e
commit 0275f4da41
2 changed files with 47 additions and 70 deletions

View File

@@ -380,20 +380,19 @@ jobs:
chown deploy:deploy "$ENV_FILE"
echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
echo "→ Pulling image: $IMAGE_TAG"
docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" pull
echo "→ Starting containers..."
docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" up -d --remove-orphans
echo "→ Starting containers (Waiting for Health)..."
# Uses --wait to ensure containers are healthy before proceeding
# This replaces the brittle 'sleep 15' and manual check
docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" up -d --wait --remove-orphans
docker system prune -f --filter "until=24h"
echo "→ Waiting 15s for warmup..."
sleep 15
echo "→ Container status:"
echo "✅ Deployment successful. Containers are Health."
docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" ps
if ! docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" ps | grep -q "Up"; then
echo "❌ Fehler: Container nicht Up!"
docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" logs --tail=150
exit 1
fi
echo "→ Applying Directus Schema Snapshot..."
# Note: We check if snapshot exists first to avoid failing if no snapshot is committed yet