| name: Deploy Documentation & Frontend App to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'Docs/**' | |
| - 'Codes/**' | |
| - 'generate_catalog.py' | |
| - '.github/workflows/deploy_docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: 'gh-pages-deploy' | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| name: Build Hub, Frontend Studios & Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up Node.js 22.x | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Generate Documentation Catalog | |
| run: | | |
| python generate_catalog.py | |
| - name: Build React 18 Frontend Studios | |
| working-directory: Codes/frontend | |
| run: | | |
| npm install --legacy-peer-deps | |
| npx tsc --noEmit | |
| NODE_OPTIONS=--max-old-space-size=4096 npm run build | |
| - name: Prepare Unified GitHub Pages Static Site | |
| run: | | |
| mkdir -p _site | |
| # 1. Copy Research Hub Docs and Interactive Comparison Studio to root | |
| cp -r Docs/* _site/ | |
| # 2. Copy React 18 Full-Stack Component Studios to /app/ | |
| mkdir -p _site/app | |
| cp -r Codes/frontend/dist/* _site/app/ | |
| # 3. Add SPA fallback for client-side routing | |
| cp _site/app/index.html _site/app/404.html || true | |
| cp _site/index.html _site/404.html || true | |
| # 4. Copy raw markdown documentation for direct reference | |
| mkdir -p _site/Codes/framework/attentions | |
| mkdir -p _site/Codes/framework/compression_engine | |
| cp Codes/framework/*.md _site/Codes/framework/ 2>/dev/null || true | |
| cp Codes/framework/attentions/*.md _site/Codes/framework/attentions/ 2>/dev/null || true | |
| cp Codes/framework/compression_engine/*.md _site/Codes/framework/compression_engine/ 2>/dev/null || true | |
| - name: Test & Verify Deployed Static Bundle | |
| run: | | |
| # Start background test web server | |
| python3 -m http.server 8080 --directory _site & | |
| SERVER_PID=$! | |
| sleep 3 | |
| echo "Testing Research Hub Root (HTTP 200)..." | |
| curl -sSf -I http://localhost:8080/ > /dev/null | |
| echo "Testing Catalog JSON Index (HTTP 200)..." | |
| curl -sSf -I http://localhost:8080/catalog.json > /dev/null | |
| echo "Testing React Component Studios App (HTTP 200)..." | |
| curl -sSf -I http://localhost:8080/app/ > /dev/null | |
| echo "Testing Markdown Docs Retrieval (HTTP 200)..." | |
| curl -sSf -I http://localhost:8080/content/attentions/nasc_attention.md > /dev/null | |
| # Stop test server | |
| kill $SERVER_PID | |
| - name: Deploy to GitHub Pages (gh-pages branch) | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_site | |
| publish_branch: gh-pages | |
| force_orphan: true | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
Xet Storage Details
- Size:
- 3.29 kB
- Xet hash:
- 1022e54ca5c6616903a3e7eef1cca3be222946d6fe8ae81b19891efec028f3fe
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.