guanghulab/.github/workflows/aoac-readme-master.yml
Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

153 lines
5.2 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ═══════════════════════════════════════════════════
# AOAC-04+05+06 · 首页同步模块 + 主控Agent + Notion信号
# AGE OS Agent Chain · 事件触发 + 时间触发双路径
# 唤醒条件1data/aoac/readme-sync-trigger.json 被写入(事件)
# 唤醒条件2每天23:00 CST = UTC 15:00时间
# 版权:国作登字-2026-A-00037559 · TCS-0002∞
# ═══════════════════════════════════════════════════
name: 🏠 AOAC-04+05+06 · 首页主控+Notion同步
on:
push:
branches: [main]
paths:
- 'data/aoac/readme-sync-trigger.json'
- 'data/aoac/chain-report.json'
schedule:
- cron: '0 15 * * *' # UTC 15:00 = 北京 23:00
workflow_dispatch:
inputs:
mode:
description: '运行模式'
type: choice
options:
- auto
- event
- scheduled
default: auto
permissions:
contents: write
concurrency:
group: aoac-readme-master
cancel-in-progress: false
jobs:
# ────────── AOAC-04 · 同步模块 ──────────
sync-module:
name: 📋 AOAC-04 · 同步模块
runs-on: ubuntu-latest
outputs:
has_payload: ${{ steps.sync.outputs.has_payload }}
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📋 执行同步模块
id: sync
run: |
node scripts/aoac/readme-sync-module.js
if [ -f "data/aoac/readme-update-payload.json" ]; then
echo "has_payload=true" >> "$GITHUB_OUTPUT"
else
echo "has_payload=false" >> "$GITHUB_OUTPUT"
fi
- name: 💾 提交更新数据
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add data/aoac/
if ! git diff --cached --quiet; then
git commit -m "📋 AOAC-04 · 同步模块数据更新 [skip ci]"
for i in 1 2 3; do
git pull --rebase origin main && git push && break
echo "⚠️ 推送冲突,第${i}次重试..."
sleep $((i * 2))
done
fi
# ────────── AOAC-05 · 首页主控Agent ──────────
master-update:
name: 🏠 AOAC-05 · 首页主控
needs: sync-module
if: always()
runs-on: ubuntu-latest
outputs:
master_report_id: ${{ steps.master.outputs.master_report_id }}
readme_updated: ${{ steps.master.outputs.readme_updated }}
changes_summary: ${{ steps.master.outputs.changes_summary }}
steps:
- name: 📥 Checkout (最新)
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 🏠 执行首页主控Agent
id: master
env:
ZY_LLM_API_KEY: ${{ secrets.ZY_LLM_API_KEY }}
ZY_LLM_BASE_URL: ${{ secrets.ZY_LLM_BASE_URL }}
run: |
MODE="${{ github.event_name == 'schedule' && 'scheduled' || github.event.inputs.mode || 'event' }}"
node scripts/aoac/readme-master-agent.js "$MODE"
- name: 📊 同步调用仪表盘生成器
run: |
if [ -f "scripts/generate-readme-dashboard.js" ]; then
node scripts/generate-readme-dashboard.js || true
fi
- name: 💾 提交README更新
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add README.md data/aoac/ data/bulletin-board/ .github/persona-brain/memory.json
if ! git diff --cached --quiet; then
git commit -m "🏠 AOAC-05 · 首页主控更新 · $(date -u '+%Y-%m-%d %H:%M') [skip ci]"
for i in 1 2 3; do
git pull --rebase origin main && git push && break
echo "⚠️ 推送冲突,第${i}次重试..."
sleep $((i * 2))
done
fi
# ────────── AOAC-06 · Notion同步信号 ──────────
notion-sync:
name: 📡 AOAC-06 · Notion同步
needs: master-update
if: always() && needs.master-update.result == 'success'
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout (最新)
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 📡 发送Notion同步信号
id: notion
env:
ZY_NOTION_TOKEN: ${{ secrets.ZY_NOTION_TOKEN }}
ZY_NOTION_RECEIPT_DB: ${{ secrets.ZY_NOTION_RECEIPT_DB }}
run: node scripts/aoac/notion-sync-signal.js
- name: 💾 提交同步日志
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add data/aoac/
if ! git diff --cached --quiet; then
git commit -m "📡 AOAC-06 · Notion同步信号已发送 [skip ci]"
for i in 1 2 3; do
git pull --rebase origin main && git push && break
echo "⚠️ 推送冲突,第${i}次重试..."
sleep $((i * 2))
done
fi