GitHub Pages Deployment Guide¶
Overview¶
Documentation is deployed to GitHub Pages automatically via GitHub Actions when you push to the main branch.
Automatic Deployment (Recommended)¶
Step 1: Enable GitHub Pages¶
- Go to your repository on GitHub
- Navigate to Settings → Pages
- Under Source, select:
- Deploy from a branch:
gh-pages(ormainif using root) - Branch:
gh-pages - Folder:
/ (root) - Click Save
Step 2: Push to Main¶
When you push changes to main:
The GitHub Actions workflow will:
1. Build the documentation
2. Deploy to GitHub Pages automatically
3. Provide a deployment URL (typically https://<username>.github.io/<repo>/)
Step 3: Access Your Docs¶
Your documentation will be available at:
Local-Only Development (No Deployment)¶
If you want to work on documentation without deploying:
Build Locally¶
This creates a site/ directory with the built HTML.
Preview Locally¶
The server auto-reloads when you save changes to .md files.
Network Access (Testing on Other Devices)¶
Manual Deployment Options¶
Option 1: Using GitHub CLI¶
Option 2: Using mkdocs gh-deploy¶
This creates/updates the gh-pages branch automatically.
Option 3: Manual Git Push¶
# Build first
make docs
# Create gh-pages branch (first time only)
cd site
git init
git add .
git commit -m "Initial documentation build"
git branch -M gh-pages
git remote add origin https://github.com/<username>/juFFTe.git
git push -u origin gh-pages
# Subsequent updates
cd ..
make docs
cd site
git add .
git commit -m "Update documentation"
git push
CI/CD Workflow Details¶
The .github/workflows/docs.yml workflow:
- Triggers on: Push to
main,develop, or manual dispatch - Builds on: Ubuntu latest with Python 3.11
- Installs:
mkdocs,mkdocs-material,mkdocs-git-revision-date-localized-plugin - Deploys: Only on push to
mainbranch - Environment:
github-pageswith proper permissions
Troubleshooting¶
Deployment Failed¶
- Check GitHub Actions tab for error logs
- Verify
mkdocs.ymlsyntax: - Ensure all referenced files exist
Pages Not Loading¶
- Check repository Settings → Pages
- Verify
gh-pagesbranch exists - Wait 1-2 minutes after deployment (CDN propagation)
Local Build Errors¶
# Reinstall dependencies
pip3 install --upgrade mkdocs mkdocs-material
# Clean and rebuild
make docs-clean
make docs
Custom Domain (Optional)¶
To use a custom domain:
-
Add
CNAMEfile todocs/: -
Configure DNS:
-
Update repository Settings → Pages → Custom domain
Security Notes¶
- GitHub Actions uses
GITHUB_TOKENwith minimal permissions - Only
pages: writeandid-token: writeare granted - No secrets required for public repositories
- Private repositories require GitHub Pro/Team/Enterprise
Next Steps¶
- Enable Pages: Settings → Pages → Select
gh-pagesbranch - Test locally:
make docs-serve - Push to main: Automatic deployment
- Customize: Add more pages, examples, and tutorials
Your documentation is now ready for GitHub Pages deployment with full local development support!