diff --git a/.github/workflows/deploy-to-server.yml b/.github/workflows/deploy-to-server.yml index 909bb8ca..ed72ef90 100644 --- a/.github/workflows/deploy-to-server.yml +++ b/.github/workflows/deploy-to-server.yml @@ -221,6 +221,18 @@ jobs: echo "✅ 全站同步完成" + - name: 🌐 注入生产环境标识 + run: | + echo "🌐 Setting HOLOLAKE_ENV=production on server..." + ssh -i ~/.ssh/deploy_key \ + "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" " + DP='${{ secrets.DEPLOY_PATH }}' + # Create environment config file for frontend detection + echo '{\"env\":\"production\",\"domain\":\"guanghulab.com\",\"deployed_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"commit\":\"${{ github.sha }}\"}' > \"\$DP/docs/env.json\" + echo '{\"env\":\"production\",\"domain\":\"guanghulab.com\",\"deployed_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"commit\":\"${{ github.sha }}\"}' > \"\$DP/env.json\" + " + echo "✅ 环境标识已注入" + - name: 📄 复制首页到站点根目录 run: | echo "📄 复制 docs/index.html → 站点根目录 index.html" diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml new file mode 100644 index 00000000..aab6924f --- /dev/null +++ b/.github/workflows/preview-deploy.yml @@ -0,0 +1,107 @@ +# ═══════════════════════════════════════════════ +# 🔺 Sovereign: TCS-0002∞ | Root: SYS-GLW-0001 +# 📜 Copyright: 国作登字-2026-A-00037559 +# ═══════════════════════════════════════════════ +name: "🧪 Preview Deploy · GitHub Pages" + +on: + push: + branches: [main] + paths: + - 'docs/**' + - 'frontend/**' + - 'status-board/**' + - 'ticket-system/**' + - 'notification/**' + - 'dynamic-comic-studio/**' + - 'user-center/**' + - 'persona-studio/frontend/**' + - 'data/bulletin-board.json' + - 'data/system-health.json' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: preview-pages + cancel-in-progress: false + +jobs: + deploy-preview: + name: "🧪 Build & Deploy Preview" + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout + uses: actions/checkout@v4 + + - name: 🔧 Setup Pages + uses: actions/configure-pages@v5 + + - name: 🏗️ Build preview site + run: | + echo "[PREVIEW] Building site for GitHub Pages..." + echo "[PREVIEW] Injecting environment marker..." + + # Sync Persona Studio frontend into docs + mkdir -p docs/persona-studio + if [ -d "persona-studio/frontend" ]; then + cp -r persona-studio/frontend/* docs/persona-studio/ + fi + + # Sync status-board into docs for GitHub Pages access + if [ -d "status-board" ]; then + mkdir -p docs/status-board + cp -r status-board/* docs/status-board/ 2>/dev/null || true + [ -d "docs/status-board/node_modules" ] && rm -rf docs/status-board/node_modules + fi + + # Sync ticket-system + if [ -d "ticket-system" ]; then + mkdir -p docs/ticket-system + cp -r ticket-system/* docs/ticket-system/ 2>/dev/null || true + fi + + # Sync notification + if [ -d "notification" ]; then + mkdir -p docs/notification + cp -r notification/* docs/notification/ 2>/dev/null || true + fi + + # Sync dynamic-comic-studio + if [ -d "dynamic-comic-studio" ]; then + mkdir -p docs/dynamic-comic-studio + cp -r dynamic-comic-studio/* docs/dynamic-comic-studio/ 2>/dev/null || true + fi + + # Sync dashboard data + if [ -d "data" ]; then + mkdir -p docs/data + cp data/system-health.json docs/data/ 2>/dev/null || true + cp data/bulletin-board.json docs/data/ 2>/dev/null || true + fi + + echo "✅ Preview build complete" + + - name: 📦 Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/ + + - name: 🚀 Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + - name: 📝 Summary + run: | + echo "### 🧪 Preview Deploy Complete" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- **Environment:** Staging (GitHub Pages)" >> $GITHUB_STEP_SUMMARY + echo "- **URL:** ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY + echo "- **Trigger:** ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY + echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY diff --git a/data/skyeye-reports/latest.json b/data/skyeye-reports/latest.json new file mode 100644 index 00000000..2e5812bb --- /dev/null +++ b/data/skyeye-reports/latest.json @@ -0,0 +1,125 @@ +{ + "schema_version": "1.0", + "scan_id": "SKYEYE-FULLSITE-2026-0325", + "timestamp": "2026-03-25T07:22:00Z", + "overall_status": "healthy", + "summary": { + "total_modules": 10, + "deployable": 4, + "needs_fix": 3, + "unavailable": 3, + "workflows": 97, + "guards": 7, + "agents": 94 + }, + "modules": [ + { + "name": "状态看板", + "path": "status-board/", + "dev": "DEV-005", + "readiness": "deployable", + "notes": "可直接嵌入主页" + }, + { + "name": "工单系统", + "path": "ticket-system/", + "dev": "DEV-010", + "readiness": "deployable", + "notes": "前端完整,localStorage 持久化" + }, + { + "name": "动态漫画工作室", + "path": "dynamic-comic-studio/", + "dev": "DEV-010", + "readiness": "deployable", + "notes": "Canvas 动画编辑器可用" + }, + { + "name": "通知中心", + "path": "notification/", + "dev": "DEV-012", + "readiness": "needs_fix", + "notes": "占位页面,需补充前端组件" + }, + { + "name": "用户中心", + "path": "user-center/", + "dev": "DEV-009", + "readiness": "needs_fix", + "notes": "仅有 README,需补充前端页面" + }, + { + "name": "前端登录", + "path": "frontend/", + "dev": "DEV-002", + "readiness": "needs_fix", + "notes": "占位页面,需对接真实验证" + }, + { + "name": "设置", + "path": "settings/", + "dev": "DEV-003", + "readiness": "unavailable", + "notes": "仅有 README" + }, + { + "name": "云盘", + "path": "cloud-drive/", + "dev": "DEV-003", + "readiness": "unavailable", + "notes": "仅有 README" + }, + { + "name": "码字台", + "path": "writing-workspace/", + "dev": "DEV-011", + "readiness": "unavailable", + "notes": "目录不存在" + }, + { + "name": "后端中间层", + "path": "backend/", + "dev": "DEV-001", + "readiness": "deployable", + "notes": "Express 服务,需服务器端运行" + } + ], + "fake_data_points": [ + { + "location": "docs/index.html:544", + "element": "#bbc", + "current": "⏳ 加载大脑…", + "fix": "已替换为真实 system-health.json 数据" + }, + { + "location": "docs/index.html:551", + "element": "#skyeye-status", + "current": "加载中…", + "fix": "已替换为真实 system-health.json 数据" + }, + { + "location": "docs/index.html:596", + "element": "#rsb", + "current": "正在加载团队数据…", + "fix": "已替换为真实 dev-status.json 数据" + }, + { + "location": "docs/index.html:677", + "element": "#bpb", + "current": "正在加载大脑数据…", + "fix": "已替换为真实 memory.json 数据" + }, + { + "location": "docs/index.html:776", + "element": "#tpb", + "current": "正在加载团队数据…", + "fix": "已替换为真实 dev-status.json 数据" + }, + { + "location": "docs/index.html:1073-1076", + "element": "announcements", + "current": "硬编码公告", + "fix": "已替换为真实 bulletin-board.json 数据" + } + ] +} diff --git a/docs/index.html b/docs/index.html index 92bf1ee0..e2763a61 100644 --- a/docs/index.html +++ b/docs/index.html @@ -356,6 +356,8 @@ footer{padding:12px 18px 16px;padding-bottom:max(16px,env(safe-area-inset-bottom .exec-btn-submit{background:var(--accent);color:#fff} .exec-btn-submit:hover{opacity:.85} .exec-btn-submit:disabled{opacity:.5;cursor:not-allowed} +/* Staging environment watermark */ +.staging-watermark{position:fixed;top:0;left:0;right:0;z-index:9999;background:rgba(251,191,36,.12);border-bottom:2px solid rgba(251,191,36,.5);padding:4px 12px;text-align:center;font-size:11px;color:#fbbf24;pointer-events:none}
@@ -485,7 +487,9 @@ footer{padding:12px 18px 16px;padding-bottom:max(16px,env(safe-area-inset-bottom @@ -904,6 +908,10 @@ const A = { devStatus: null, notionProfile: null, skyeyeReport: null, + systemHealth: null, + bulletinBoard: null, + federationStatus: null, + telemetrySummary: null, msgs: [], currentConvId: null, currentView: 'announcements', @@ -916,6 +924,17 @@ const A = { userMeta: null, }; +// ═══════════════════════════════════════════════════════ +// ENVIRONMENT DETECTION (staging vs production) +// ═══════════════════════════════════════════════════════ +const HOLOLAKE_ENV = (function(){ + const host = window.location.hostname; + if(host === 'guanghulab.com' || host === 'www.guanghulab.com') return 'production'; + if(host.includes('github.io')) return 'staging'; + return 'local'; +})(); +window.HOLOLAKE_ENV = HOLOLAKE_ENV; + function ls(k){return localStorage.getItem(k)} function lss(k,v){localStorage.setItem(k,v)} @@ -1067,13 +1086,31 @@ function renderAnnouncements(){ const c=b.stats?.coverage||FB_COV; const evs=(b.events||[]).slice(-5).reverse(); const meta=A.userMeta; + const bb=A.bulletinBoard; + const sh=A.systemHealth; + const fs=A.federationStatus; + const tl=A.telemetrySummary; let h=''; - // System announcements + + // Environment watermark + if(HOLOLAKE_ENV==='staging'){ + h+='