All checks were successful
E2E Health Check / e2e-health (push) Successful in 18s
1. E2E Health: Docker 容器無法訪問內網 IP,改用公網域名 2. metrics_repository: asyncpg 需要 datetime 物件,不能用字串 3. metrics_repository: PostgreSQL 用 date_trunc 而非 strftime 2026-03-31 ogt: 首席架構師審查發現並修復 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
# =============================================================================
|
||
# AWOOOI E2E Health Check (Gitea Actions - 方案 B)
|
||
# =============================================================================
|
||
# 替代 GitHub Actions 的本地 CI/CD
|
||
# 2026-03-29 Claude Code (ADR-039)
|
||
# 2026-03-31 Claude Code (Phase 21.1 - 每日排程 + 失敗通知)
|
||
|
||
name: E2E Health Check
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
workflow_dispatch:
|
||
schedule:
|
||
- cron: '0 16 * * *' # 每日 00:00 台北 (UTC+8)
|
||
|
||
jobs:
|
||
e2e-health:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Check API Health
|
||
id: health_check
|
||
run: |
|
||
sudo apt-get update && sudo apt-get install -y curl || (apt-get update && apt-get install -y curl)
|
||
# 2026-03-31 ogt: Docker 容器無法訪問內網 IP,改用公網域名
|
||
API_URL="https://awoooi.wooo.work"
|
||
echo "🔗 檢查 API 健康狀態..."
|
||
|
||
for i in 1 2 3; do
|
||
HTTP_CODE=$(curl -s -w "%{http_code}" -o /dev/null --connect-timeout 10 "$API_URL/api/v1/health" 2>&1) || true
|
||
echo "📊 嘗試 #$i: HTTP $HTTP_CODE"
|
||
|
||
if [ "$HTTP_CODE" = "200" ]; then
|
||
echo "✅ API 可用"
|
||
echo "status=success" >> $GITHUB_OUTPUT
|
||
exit 0
|
||
fi
|
||
sleep 2
|
||
done
|
||
|
||
echo "❌ API 無法連線"
|
||
echo "status=failed" >> $GITHUB_OUTPUT
|
||
exit 1
|
||
|
||
- name: Notify Telegram on Failure
|
||
if: failure()
|
||
run: |
|
||
curl -s -X POST "https://api.telegram.org/bot${{ secrets.OPENCLAW_TG_BOT_TOKEN }}/sendMessage" \
|
||
-d chat_id="${{ secrets.OPENCLAW_TG_CHAT_ID }}" \
|
||
-d parse_mode="HTML" \
|
||
-d text="🔴 <b>[E2E Health Check]</b> 失敗%0A%0A📅 $(TZ=Asia/Taipei date '+%Y-%m-%d %H:%M')%0A🔗 API 健康檢查未通過%0A%0A請檢查 K3s 叢集狀態"
|
||
|