Deploying¶
lectrace deploys to GitHub Pages with a single command. No Node.js, no build steps on your machine — everything runs in GitHub Actions.
One-time setup¶
1. Initialize¶
In your repo root:
This creates:
.github/workflows/lectrace.yml— the GitHub Actions workflowlectrace.toml— optional configuration file- Updates
.gitignoreto exclude_site/and cache files
2. Enable GitHub Pages¶
In your GitHub repository:
- Go to Settings → Pages
- Under Source, select GitHub Actions
- Save
3. Push¶
GitHub Actions runs, builds your lectures, and deploys them. Your site is live at:
What the workflow does¶
The generated workflow (.github/workflows/lectrace.yml):
- Checks out your repo
- Installs your project's dependencies (if
pyproject.tomlis present) - Installs
lectrace - Runs
lectrace build --output _site - Deploys
_site/to GitHub Pages
It runs on every push to main and can also be triggered manually from the Actions tab.
Project dependencies¶
If your lecture files import third-party libraries, declare them in your project so the workflow installs them:
The workflow detects both formats automatically.
Multiple lectures¶
lectrace auto-discovers all lecture files in your repo. Name them with numeric prefixes to control sidebar order:
All four will appear in the sidebar, ordered as listed.
Incremental builds¶
lectrace build caches trace results by source hash. On subsequent pushes, only modified files are re-executed — unchanged lectures rebuild in milliseconds.
To force a full rebuild:
Custom output directory¶
The default output is _site/. Change it in lectrace.toml or via the flag:
Update the workflow's path: accordingly if you change the default.
Local preview before pushing¶
Always preview locally before pushing:
Builds and serves at http://localhost:7000 with live reload on file save.