Continuous build and publishing#
You can build and publish the website automatically on push using GitHub Pages and GitHub Actions. Here's our recommendation:
.github/workflows/deploy-docs.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Why configure like this
- Do not disable the workflow for non-master branches or pull requests. It is nice to ensure that the site builds (there can be errors!), instead at the bottom we prevent only the actual deploy action from being executed on non-master/non-pushes.
- Dependencies are installed from
requirements.txt
. Make sure you've populated it.
Tip
You can freely have a "dev" branch for working on docs that aren't ready for release yet. Then just merge it into the main one when ready.
Tip
Your docs don't have to be in the same repository as the main code. In fact, the doc site can span several projects! See "Multi-repo setup" in Showcase.