From 784ca17072ee16ac01fc5ca1a84992c16ad9ad4b Mon Sep 17 00:00:00 2001 From: repair-agent Date: Tue, 24 Feb 2026 13:17:13 +0800 Subject: [PATCH] feat(ops): add CI/CD failure reporting to Log Center Report build/deploy failures to Log Center with source: cicd Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/deploy.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index de2dfa6..3877d24 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -73,3 +73,34 @@ jobs: else kubectl rollout restart deployment/rtc-web-dev fi + + - name: Report failure to Log Center + if: failure() + run: | + curl -s -X POST "https://qiyuan-log-center-api.airlabs.art/api/v1/logs/report" \ + -H "Content-Type: application/json" \ + -d "{ + \"project_id\": \"rtc_web\", + \"environment\": \"${{ github.ref_name }}\", + \"level\": \"ERROR\", + \"source\": \"cicd\", + \"commit_hash\": \"${{ github.sha }}\", + \"repo_url\": \"https://gitea.airlabs.art/zyc/rtc_web.git\", + \"error\": { + \"type\": \"CICDFailure\", + \"message\": \"Build and Deploy failed on branch ${{ github.ref_name }}\", + \"stack_trace\": [ + \"Repository: ${{ github.repository }}\", + \"Branch: ${{ github.ref_name }}\", + \"Commit: ${{ github.sha }}\", + \"Run ID: ${{ github.run_id }}\", + \"Actor: ${{ github.actor }}\" + ] + }, + \"context\": { + \"workflow\": \"${{ github.workflow }}\", + \"run_id\": \"${{ github.run_id }}\", + \"branch\": \"${{ github.ref_name }}\", + \"actor\": \"${{ github.actor }}\" + } + }" || true