Publishing documentation¶
If your source_url is on GitHub, you can automatically deploy your documentation to your repository’s GitHub Pages site. This deployment is controlled by the deploy_docs setting.
Setup¶
To enable documentation publishing, follow these steps:
On GitHub, navigate to your repository and click on
Settings.Select
Pages.Under
Build and deployment source, ensureGitHub Actionsis selected.Select
Environments.Click on
github-pages.Under
Deployment branches and tags, click onAdd deployment branch or tag ruleEnsure
Ref typeisBranch(the default).As the
Name pattern, enterrelease/auto(the branch name used by the automated release PR).Click on
Add rule.
Once configured, your documentation is automatically published to your GitHub Pages site when publishing a release or after pushes to the default branch (if deploy_docs == rolling).
Further steps¶
Docs URL in metadata¶
Ensure the docs_url points to your GitHub Pages site. This URL is included in the project’s PyPI metadata and ensures that the README.md contains a link to the user documentation.
Repository website¶
Consider setting your GitHub Pages site as the project’s website on GitHub:
In your repository, click the settings wheel in the top right corner (not the
Settingstab in the navigation bar).Under
Website, selectUse your GitHub Pages website.