.gitea/workflows/deploy.yml Güncelle
Deploy Iddaai Backend / build-and-deploy (push) Successful in 4m56s
Deploy Iddaai Backend / build-and-deploy (push) Successful in 4m56s
This commit is contained in:
+26
-13
@@ -11,13 +11,27 @@ jobs:
|
|||||||
- name: Kodu Cek
|
- name: Kodu Cek
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Docker Build
|
- name: Docker Build (Backend)
|
||||||
run: docker build -t iddaai-be:latest .
|
run: docker build -t iddaai-be:latest .
|
||||||
|
|
||||||
- name: Eski Konteyneri Sil
|
- name: Docker Build (AI Engine)
|
||||||
run: docker rm -f iddaai-be || true
|
run: docker build -t iddaai-ai-engine:latest ./ai-engine
|
||||||
|
|
||||||
- name: Yeni Versiyonu Baslat
|
- name: Eski Konteynerleri Sil
|
||||||
|
run: |
|
||||||
|
docker rm -f iddaai-be || true
|
||||||
|
docker rm -f iddaai-ai-engine || true
|
||||||
|
|
||||||
|
- name: AI Engine'i Baslat
|
||||||
|
run: |
|
||||||
|
docker run -d \
|
||||||
|
--name iddaai-ai-engine \
|
||||||
|
--restart unless-stopped \
|
||||||
|
--network iddaai_iddaai-network \
|
||||||
|
-e DATABASE_URL='${{ secrets.DATABASE_URL }}' \
|
||||||
|
iddaai-ai-engine:latest
|
||||||
|
|
||||||
|
- name: Backend'i Baslat
|
||||||
run: |
|
run: |
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name iddaai-be \
|
--name iddaai-be \
|
||||||
@@ -34,13 +48,12 @@ jobs:
|
|||||||
-e JWT_ACCESS_EXPIRATION='1d' \
|
-e JWT_ACCESS_EXPIRATION='1d' \
|
||||||
iddaai-be:latest /bin/sh -c "npx prisma migrate deploy && node dist/src/main.js"
|
iddaai-be:latest /bin/sh -c "npx prisma migrate deploy && node dist/src/main.js"
|
||||||
|
|
||||||
- name: AI Engine Network Alias Garantile
|
- name: Saglik Kontrolu
|
||||||
run: |
|
run: |
|
||||||
AI_CONTAINER=$(docker ps --format '{{.Names}}' | grep iddaai-ai-engine | head -1)
|
sleep 10
|
||||||
if [ -n "$AI_CONTAINER" ]; then
|
echo "=== AI Engine logs ==="
|
||||||
docker network disconnect iddaai_iddaai-network $AI_CONTAINER 2>/dev/null || true
|
docker logs --tail 30 iddaai-ai-engine || true
|
||||||
docker network connect --alias iddaai-ai-engine iddaai_iddaai-network $AI_CONTAINER
|
echo "=== Backend logs ==="
|
||||||
echo "AI engine alias eklendi: $AI_CONTAINER"
|
docker logs --tail 30 iddaai-be || true
|
||||||
else
|
echo "=== AI Engine health ==="
|
||||||
echo "AI engine container bulunamadi, alias atlanamadi"
|
docker exec iddaai-ai-engine python -c "import urllib.request; print(urllib.request.urlopen('http://127.0.0.1:8000/health').read().decode())" || echo "AI engine health check failed"
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user