# ADR-039: GitHub → Gitea CI/CD 遷移 | 項目 | 內容 | |------|------| | **狀態** | ✅ 已完成 | | **日期** | 2026-03-29 | | **決策者** | 統帥 | | **執行者** | Claude Code | ## 背景 GitHub Actions 在自建 Runner 環境下存在以下問題: 1. 網路連接不穩定 (curl 成功但 Python httpx 失敗) 2. Runner 環境隔離問題 3. 頻繁的間歇性失敗影響每日 E2E 健康檢查 ## 決策 **方案 B: 遷移到 Gitea Actions** ### 架構變更 ``` Before: GitHub (主倉) → GitHub Actions (CI/CD) → Harbor → K8s After: GitHub (只讀備份) Gitea (主倉) → Gitea Actions (CI/CD) → Harbor → K8s ``` ### 遷移步驟 | Phase | 動作 | 驗證條件 | |-------|------|----------| | 1 | Gitea CI/CD 設置 | E2E 測試通過 | | 2 | 停用 GitHub Actions | 無並行期 | ## 影響範圍 ### 需要修改 | 項目 | 修改內容 | |------|----------| | `.gitea/workflows/` | 新建 Gitea Actions workflows | | `docs/reference/SERVICE-ENDPOINTS.md` | 更新 CI/CD 端點 | | Memory | 更新 reference 和 feedback | | LOGBOOK | 記錄遷移狀態 | ### 不變更 | 項目 | 說明 | |------|------| | Harbor | 維持 192.168.0.110:5000 | | K8s 部署 | 維持現有流程 | | Secrets | 從 GitHub 複製到 Gitea | ## Gitea Actions 配置 ### Secrets (已設置) | Secret | 用途 | |--------|------| | `WEBHOOK_HMAC_SECRET` | E2E HMAC 驗證 | | `HARBOR_USERNAME` | 映像推送 | | `HARBOR_PASSWORD` | 映像推送 | ### Runner | 項目 | 值 | |------|-----| | Runner Name | wooo-runner | | Container | gitea/act_runner:latest | | 位置 | 192.168.0.110 | ## 回滾計劃 若 Gitea CI/CD 不穩定: 1. 重新啟用 GitHub Actions workflows 2. Gitea 降級為只讀備份 3. 記錄失敗原因 ## 相關文件 - [reference_gitea_mirror.md](~/.claude/projects/-Users-ogt-awoooi/memory/reference_gitea_mirror.md) - [feedback_cicd_aiops_patterns.md](~/.claude/projects/-Users-ogt-awoooi/memory/feedback_cicd_aiops_patterns.md)