GitHub Pages Deployment Guide¶
This guide explains how to publish and maintain the ReUseIt documentation using MkDocs Material on GitHub Pages.
1. Overview¶
The documentation is located in the docs/ directory and configured via mkdocs.yml. A GitHub Actions workflow (.github/workflows/docs.yml) automatically builds and deploys the site on every push to main affecting documentation files.
2. Prerequisites¶
- Repository hosted on GitHub (
Pranavraut033/reuseit) mainbranch is the default branch- Actions enabled for the repository
3. Local Preview¶
To preview the documentation locally:
Open http://127.0.0.1:8000 in your browser.
4. Deployment Workflow¶
The workflow file at .github/workflows/docs.yml performs these steps:
- Checkout repository
- Install MkDocs dependencies
- Build static site into
site/ - Upload build artifact
- Deploy to GitHub Pages using
actions/deploy-pages
You do not need to manually run any commands—deployment is automatic.
5. Manual Trigger¶
You can manually trigger deployment using the "Run workflow" button in the GitHub Actions UI (Workflow: Deploy Documentation to GitHub Pages).
6. Adding / Updating Content¶
- Create or edit Markdown files in
docs/ - Update navigation in
mkdocs.ymlif adding a new page - Commit and push changes:
The site will rebuild automatically (typical build time: <1 min).
7. Custom Domain (Optional)¶
If you want to use a custom domain:
- Go to repository Settings → Pages
- Add your custom domain (e.g.,
docs.reuseit.app) - Create a
CNAMEfile indocs/with your domain name:
- Commit and push.
8. Analytics (Optional)¶
To enable Google Analytics:
- Replace
G-XXXXXXXXXXinmkdocs.ymlunderextra.analytics.property - Commit and push changes
9. Theme Customization¶
Modify the theme: section in mkdocs.yml to adjust colors, icons, or features.
Example change (primary color):
10. Common Issues¶
| Issue | Cause | Solution |
|---|---|---|
| 404 on Pages site | Build artifact missing | Verify workflow ran successfully |
| Styling broken | Cached CSS | Hard refresh (Cmd+Shift+R) |
| Page not listed | Missing nav entry | Add page to nav: in mkdocs.yml |
| Broken links | Renamed files | Use relative links & update navigation |
11. Cleanup¶
To remove old deployment artifacts:
- Go to Actions → Select latest run
- Click "Artifacts" → Delete (optional maintenance)
12. Verification Checklist¶
After deployment:
- [ ] Site accessible at
https://pranavraut033.github.io/reuseit/ - [ ] Navigation contains all expected pages
- [ ] Dark/light mode toggle works
- [ ] Search bar returns results
- [ ] External links function
13. Example Commit¶
git add docs/04-implementation.md mkdocs.yml
git commit -m "docs: add performance benchmarks section"
git push origin main
14. Rollback Strategy¶
If a deployment introduces issues:
- Revert commit locally:
- Push revert:
- Workflow redeploys previous stable version automatically.
15. Updating MkDocs Version¶
To update dependencies:
Commit changes only if configuration requires updates.
16. Security Considerations¶
- GitHub Pages serves static content only (no backend exposure)
- No secrets stored in documentation
- Avoid embedding sensitive environment variables or credentials in markdown files.
17. File Summary¶
| File | Purpose |
|---|---|
mkdocs.yml | MkDocs configuration (navigation, theme) |
.github/workflows/docs.yml | Automation workflow for deployment |
docs/*.md | Documentation content |
site/ | Generated build output (ignored from version control) |
18. Next Steps¶
For enhancements:
- Add versioning (via
miketool) - Integrate diagrams (Mermaid via
pymdownx.superfences) - Add changelog page generated from Conventional Commits
Last Updated: December 2025