ci(k8s): Gitea K8s pipeline ekle — CiroMarket K8s migration

Ne yaptık:
- .gitea/workflows/deploy-backend.yaml — Gitea Actions ile backend image'ı build et, Gitea registry'e push et, ci-cd repo manifest'ini bump'la
- .gitea/workflows/deploy-frontend.yaml — Frontend'i VITE_API_URL=https://trendyol-api.194.187.253.61.sslip.io ile build et, aynı pattern
- .github/workflows/deploy.yml — sync-gitea job eklendi: GitHub push sonrası Gitea mirror sync + deploy-backend/frontend.yaml dispatch

Neden yaptık:
- CiroMarket'i Coolify'dan K8s'e taşıma projesi
- Coolify pipeline parallel çalışmaya devam ediyor (zero downtime)
- GitHub push → Gitea mirror → Gitea Actions → Gitea registry → ArgoCD → K8s rolling update zinciri tamamlandı
This commit is contained in:
furkanyigit34
2026-05-18 11:42:02 +03:00
parent 5af14c8d80
commit eb679300f3
3 changed files with 205 additions and 0 deletions

View File

@@ -4,6 +4,9 @@ name: Deploy
# Zincir: validate → build-push (backend+frontend) → deploy → verify
# Trendyol-analiz tertemiz auto-deploy — SellerX deploy-frontend.yml pattern'i
# ─────────────────────────────────────────────────────────────────────────────
# K8s pipeline (Gitea mirror → Gitea Actions → Gitea registry → ArgoCD) parallel
# çalışır — Coolify pipeline'ı DURDURMAZ.
# ─────────────────────────────────────────────────────────────────────────────
on:
push:
@@ -18,6 +21,53 @@ env:
NODE_VERSION: '20'
jobs:
# ───────────────────────────────────────────────────────────────────────────
# K8s MIRROR SYNC — Coolify pipeline'dan BAĞIMSIZ, validate ile PARALEL.
# GitHub push → Gitea mirror sync → Gitea Actions → Gitea registry → ArgoCD
# Başarısız olursa Coolify pipeline DURMUYOR.
# ───────────────────────────────────────────────────────────────────────────
sync-gitea:
name: Sync Gitea Mirror (K8s Pipeline)
runs-on: ubuntu-latest
steps:
- name: Trigger Gitea mirror sync
run: |
HTTP=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://git.novasis.tr/api/v1/repos/admin/trendyol-analiz/mirror-sync" \
-H "Authorization: token ${{ secrets.GITEA_MIRROR_TOKEN }}")
echo "Mirror sync HTTP: $HTTP"
if [ "$HTTP" -ge 400 ]; then
echo "Mirror sync failed (HTTP $HTTP) — K8s pipeline delayed, Coolify unaffected"
exit 0
fi
echo "Mirror sync triggered — waiting 30s for sync to complete..."
sleep 30
- name: Dispatch Gitea Actions build (deploy-backend.yaml)
run: |
HTTP=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://git.novasis.tr/api/v1/repos/admin/trendyol-analiz/actions/workflows/deploy-backend.yaml/dispatches" \
-H "Authorization: token ${{ secrets.GITEA_MIRROR_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"ref":"main"}')
echo "Gitea backend dispatch HTTP: $HTTP"
if [ "$HTTP" -ge 400 ]; then
echo "Gitea backend dispatch failed — trigger manually"
fi
- name: Dispatch Gitea Actions build (deploy-frontend.yaml)
run: |
HTTP=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://git.novasis.tr/api/v1/repos/admin/trendyol-analiz/actions/workflows/deploy-frontend.yaml/dispatches" \
-H "Authorization: token ${{ secrets.GITEA_MIRROR_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"ref":"main"}')
echo "Gitea frontend dispatch HTTP: $HTTP"
if [ "$HTTP" -ge 400 ]; then
echo "Gitea frontend dispatch failed — trigger manually"
fi
# ───────────────────────────────────────────────────────────────────────────
# ADIM 1a — Backend hızlı sağlık testi (pytest)
# ───────────────────────────────────────────────────────────────────────────