fix(ci): attach infra containers to meezi_default network before deploy
CI/CD / CI · API (dotnet build + test) (push) Successful in 40s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 36s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m2s
CI/CD / CI · Admin Web (tsc) (push) Successful in 35s
CI/CD / CI · Website (tsc) (push) Successful in 44s
CI/CD / CI · Koja (tsc) (push) Successful in 48s
CI/CD / Deploy · all services (push) Failing after 10s

postgres/redis were created before the compose project name was locked
to "meezi", so they're on a different Docker network. New app containers
join meezi_default — the API crashes immediately because it can't reach
Host=postgres.

Fix: create meezi_default if needed, then docker network connect
meezi-db and meezi-redis to it before starting the app containers.

Also dump API and admin-api logs on failure to make future failures
easier to diagnose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-01 08:39:35 +03:30
parent aea1d20fdc
commit c3ea07d6e4
+21
View File
@@ -321,6 +321,17 @@ jobs:
docker rm "$name" 2>/dev/null || true
done
- name: Attach infrastructure to meezi network
# The postgres/redis containers may have been created before the compose
# project name was locked to "meezi", so they live on a different network.
# New app containers join meezi_default — connect infra to that network
# so the API can reach "postgres" and "redis" by service name.
run: |
docker network inspect meezi_default >/dev/null 2>&1 \
|| docker network create meezi_default
docker network connect meezi_default meezi-db 2>/dev/null || true
docker network connect meezi_default meezi-redis 2>/dev/null || true
- name: Deploy main app services
run: |
docker compose up -d --no-deps api web website koja
@@ -358,4 +369,14 @@ jobs:
if: always()
run: docker compose -f docker-compose.yml -f docker-compose.admin.yml ps
- name: Dump API logs on failure
if: failure()
run: |
echo "=== meezi-api logs ==="
docker logs meezi-api --tail=60 2>&1 || true
echo "=== meezi-admin-api logs ==="
docker logs meezi-admin-api --tail=30 2>&1 || true
echo "=== meezi_default network ==="
docker network inspect meezi_default 2>&1 || true
# Intentionally no image pruning — disk cleanup is done manually on the server.