mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-07-19 18:14:33 -05:00
Documentation updates across the codebase: Root documentation: - README.md: Updated references from book/ to site/ - CONTRIBUTING.md: Updated build and workflow instructions - .shared-ai-rules.md: Updated AI assistant rules for new structure GitHub configuration: - Issue templates updated for new module locations - Workflow references updated from book/ to site/ docs/ updates: - STUDENT_QUICKSTART.md: New paths and structure - module-rules.md: Updated module development guidelines - NBGrader documentation: Updated for module restructuring - Archive documentation: Updated references Module documentation: - modules/17_memoization/README.md: Updated after reordering All documentation now correctly references: - site/ instead of book/ - modules/XX_name/ instead of modules/source/
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: Deploy TinyTorch Jupyter Book (Streamlined with tito)
|
|
|
|
# Trigger the workflow on push to main branch (publishing) or manual dispatch
|
|
# This workflow uses tito CLI for consistent book generation and building
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'site/**'
|
|
- 'modules/**'
|
|
- '.github/workflows/deploy-book.yml'
|
|
- 'tito/**' # Also trigger when tito CLI changes
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'site/**'
|
|
- 'modules/**'
|
|
- 'tito/**'
|
|
workflow_dispatch:
|
|
|
|
# Set permissions for GitHub Pages deployment and content modification
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Allow only one concurrent deployment
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install "jupyter-book<1.0"
|
|
pip install -r site/requirements.txt || pip install jupyter-book
|
|
|
|
- name: Build Jupyter Book
|
|
run: |
|
|
cd site
|
|
jupyter-book clean . || true
|
|
jupyter-book build .
|
|
echo "=== Contents of site after build ==="
|
|
ls -la
|
|
echo "=== Contents of _build (if exists) ==="
|
|
ls -la _build/ || echo "_build doesn't exist"
|
|
echo "=== Contents of _build/html (if exists) ==="
|
|
ls -la _build/html/ || echo "_build/html doesn't exist"
|
|
|
|
- name: Upload book artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: site/_build/html
|
|
|
|
deploy:
|
|
# Only deploy on main branch pushes (not PRs)
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4 |