ci: tertemiz auto-deploy workflow ekle (SellerX pattern)

Ne yaptık:
- .github/workflows/deploy.yml: validate (backend pytest + frontend lint/build)
  → build-push GHCR (backend + frontend image) → Coolify webhook
  → verify (Coolify polling + public URL health check) → notify-failure
  (GitHub issue auto-create) zinciri eklendi.
- .github/workflows/ci.yml: eski "Deploy to Coolify" job'u kaldırıldı.
  CI artık sadece test + build doğrulaması yapıyor; deploy ayrı workflow'a alındı.
- Trigger: main branch'e push (workflow_dispatch ile manuel de tetiklenebilir).

Neden yaptık:
- Şu ana kadar Coolify deploy manuel tetikleniyordu (CLAUDE.md "Coolify deploy
  otomatik tetiklenmez" notu). Her push sonrası Coolify panel'inden el ile
  redeploy gerekiyordu.
- SellerX'in deploy-frontend.yml mimarisi — validate → build-push → deploy
  → verify zinciri — battle-tested. Aynı pattern'i trendyol-analiz'e port
  ediyoruz.
- GHCR'a image push: ileride Coolify build yerine "image: ghcr.io/..." pull
  yapabilsin diye. Şu an compose 'build:' kullansa bile cache + rollback için
  GHCR'da hazır image bulunuyor.
- verify polling + public URL health check: deploy başarısız olursa GitHub
  Actions otomatik fail eder ve notify-failure GitHub Issue açar.

Gerekli GitHub Secrets (Settings → Secrets and variables → Actions):
- COOLIFY_BASE_URL
- COOLIFY_API_TOKEN
- COOLIFY_TRENDYOL_UUID = x4c08gc84kcw4oow0ggg44cg
This commit is contained in:
2026-04-25 15:35:15 +03:00
parent 2755ae28f0
commit e007cfc398
2 changed files with 306 additions and 13 deletions

View File

@@ -202,16 +202,4 @@ jobs:
if: always()
run: docker compose -f docker-compose.test.yml down -v
# Deploy to Coolify (only on main push)
deploy:
name: Deploy to Coolify
runs-on: ubuntu-latest
needs: [docker-build, integration]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Trigger Coolify Deployment
run: |
curl -X POST "${{ secrets.COOLIFY_WEBHOOK }}" \
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
--fail --max-time 30
# Deploy is handled by .github/workflows/deploy.yml (auto-trigger on main push)