GitHub Pages Setup Instructions¶
To properly display the MkDocs documentation on GitHub Pages, please follow these steps:
-
Go to your repository's Settings tab on GitHub.
-
In the left sidebar, click on "Pages" under "Code and automation".
-
Under "Build and deployment", set the following:
- Source: "Deploy from a branch"
- Branch: "gh-pages" (select this from the dropdown)
-
Folder: "/" (root)
-
Click "Save".
After completing these steps, GitHub Pages will automatically deploy your documentation from the gh-pages branch whenever it's updated by the GitHub Actions workflow.
How It Works¶
The GitHub Actions workflow (publish-docs.yml
) does the following:
-
It triggers when changes are pushed to the
docs/
directory ormkdocs.yml
file on the main branch. -
It builds the MkDocs site using the configuration in mkdocs.yml.
-
It uses the JamesIves/github-pages-deploy-action to deploy the built site to the gh-pages branch.
-
GitHub Pages then serves the content from the gh-pages branch.
Troubleshooting¶
If you encounter issues with the GitHub Pages deployment:
-
Check the GitHub Actions workflow run to see if there were any errors during the build or deployment.
-
Verify that the gh-pages branch exists and contains the built documentation.
-
Ensure that GitHub Pages is configured to deploy from the gh-pages branch.
-
Check if the repository has the necessary permissions for GitHub Actions to push to the gh-pages branch.