Files
awoooi/docs/adr/ADR-039-gitea-cicd-migration.md
OG T 97b2e059bc
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
E2E Health Check / e2e-health (push) Has been cancelled
docs: ADR-039 完成 - Gitea CI/CD 遷移成功
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 01:07:51 +08:00

87 lines
2.0 KiB
Markdown

# 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)