Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub: Add a GitHub Action to publish docs
Add a GitHub Action to publish docs automatically, whenever someone pushes against the "main" branch. Note we have chosen to implement the actual business logic of publishing docs as part of the Makefile, rather than as part of the GitHub Action directly. This means we only use the GitHub action to *automate* the invocation of pre-existing business logic. This allows us to run the exact same logic both locally and within a GitHub Action. See here for interesting context: https://news.ycombinator.com/item?id=33751533 Also note we disable shallow fetches to fetch all tags and the full history, so we can calculate a version based on annotated tags. Also note we check out the repository *twice*, a second time under _pages/, so the checkout action has a chance to persist the Action-specific credentials under _pages/. We do it so we have the credentials we need to push to the "gh-pages" branch later on. Also note we set git-specific environment variables for author and committer username/email explicitly to make the new commits in the "gh-pages" branch appear as coming from the GitHub Actions bot. Otherwise git was complaining that it couldn't determine the identity of the author and/or committer. See here for details: https://github.com/actions/checkout#push-a-commit-using-the-built-in-token https://github.com/orgs/community/discussions/26560 Finally, ensure the docs-clean target actually depends on having created the managed Python virtualenv, because it needs Sphinx-provided commands. Signed-off-by: Vangelis Koukis <[email protected]>
- Loading branch information