Deployment¶
There are two ways to deploy your MkDocs site.
Local Preview¶
Before deploying, always preview your site locally:
mkdocs serve
➡️ Open http://127.0.0.1:8000 to view the live preview.
Manual Deployment¶
Use this command to build and deploy manually:
mkdocs gh-deploy --force
This will:
- Build your site into the site/
directory
- Force-push the contents to the gh-pages
branch
- Make it live on GitHub Pages
Automated Deployment¶
If you've configured CI/CD with GitHub Actions, just push to main
:
git add .
git commit -m "Update docs"
git push
Your GitHub Actions workflow will:
- Install dependencies
- Build the site
- Push to gh-pages
automatically
Clean Builds (Optional)¶
To clean the build before redeploying:
mkdocs build --clean
mkdocs gh-deploy --force
Screenshots (Optional)¶
Include screenshots of:
- GitHub Actions output
- gh-pages
branch contents
- Live site view
Use this format:
