π οΈ Build & Deploy (maintainers)¶
This page is for maintainers of the site β students don't need it.
This site is built with MkDocs + the
Material theme. The slide decks under
docs/slides/ are built separately with Marp.
1. Install MkDocs + dependencies¶
conda activate mypy311 # or any Python 3.11 env
pip install mkdocs mkdocs-material
2. Serve locally¶
mkdocs serve # http://localhost:8000
3. Build a static site¶
mkdocs build # output in site/
4. Export to PDF (optional)¶
Use the browser's Print β Save as PDF from localhost:8000, or install weasyprint.
5. Publish to GitHub Pages¶
mkdocs gh-deploy --force # publishes to https://lkk688.github.io/edgeAI/
Use
--force.gh-pagesis fully regenerated fromdocs/each time, and the GitHub Action (Β§7) also pushes there β so without--forcea manual deploy is often rejected with! [rejected] gh-pages -> gh-pages (fetch first)(a non-fast-forward). Force-pushing generated content is safe. To avoid the two deployers leap-frogging, either rely on the Action (justgit pushtomain) or deploy manually β not both.
6. Build the slide decks (Marp)¶
The Marp sources live in docs/slides/*.md and are excluded from the MkDocs build
(exclude_docs in mkdocs.yml); only the built *.html is published.
./docs/slides/build.sh # docs/slides/*.md -> docs/slides/*.html
./docs/slides/build.sh --pdf # also export PDF handouts
Then mkdocs gh-deploy copies the built decks; e.g. the getβstarted deck goes live at
https://lkk688.github.io/edgeAI/slides/get-started.html. See
docs/slides/README.md for authoring tips.
7. Auto-deploy with GitHub Actions (recommended)¶
The repo includes a workflow at .github/workflows/deploy-docs.yml that publishes the site β
including the Marp slide decks β to the gh-pages branch on every push to main. It:
- installs
mkdocs+mkdocs-material, - builds the slide decks (
docs/slides/build.sh), - runs
mkdocs gh-deploy --force.
One-time repo setup (in the GitHub web UI):
- Settings β Actions β General β Workflow permissions β choose βRead and write permissionsβ β Save.
(Lets the Action push the built site to
gh-pages; the workflow already declarespermissions: contents: write.) - Settings β Pages β Build and deployment β Source β Deploy from a branch β branch
gh-pages, folder/ (root).
After that, just git push to main β the Action builds and deploys, and the site (with slides) updates
in ~1β2 minutes. You can also run it on demand from the Actions tab β Deploy docs + slides β Run workflow.
β οΈ A plain
git pushupdates the live site only because this Action runsmkdocs gh-deploy. Without the Action (or a manualmkdocs gh-deploy), thegh-pagesbranch β and the live site β stays stale.