Deploying Documentation to GitHub Pages
This guide explains how to deploy the OpenUptimes documentation to GitHub Pages.
Automatic Deployment
The documentation is automatically deployed to GitHub Pages whenever changes are pushed to the main branch that affect:
- Files in the docs/ directory
- The mkdocs.yml configuration file
- The GitHub Actions workflow file
This is handled by the GitHub Actions workflow defined in .github/workflows/documentation.yml.
Manual Deployment
If you need to deploy the documentation manually:
- Ensure you have MkDocs Material installed:
- From the project root, run:
This command builds the documentation and pushes it to the gh-pages branch, which is then served by GitHub Pages.
Deployment Settings
The documentation is deployed to: https://[username].github.io/openuptimes/
GitHub Repository Settings
To ensure GitHub Pages works correctly:
- Go to your repository's Settings tab
- Navigate to Pages in the sidebar
- Under Source, select Deploy from a branch
- Select the gh-pages branch and / (root) folder
- Click Save
Troubleshooting
Images Not Displaying
- Ensure images are in the
docs/assets/directory - Check that image paths in markdown files are correct
- Use relative paths from the current markdown file (e.g.,
../assets/image.png)
Styling Issues
- Check that
extra_cssinmkdocs.ymlpoints to the correct file - Verify that custom CSS is compatible with MkDocs Material
- Test locally with
mkdocs servebefore deploying
Deployment Failures
- Check the GitHub Actions workflow runs for errors
- Ensure the repository has the necessary permissions
- Verify that the
gh-pagesbranch exists