Skip to content

Commit

Permalink
GitHub: Add a GitHub Action to publish docs
Browse files Browse the repository at this point in the history
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

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
vkoukis committed Dec 27, 2024
1 parent 870423d commit 23b8b81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docs-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: docs-publish

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
docs-publish:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@main
- name: publish docs
run: make docs-publish
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ docs: docs-build
docs-build: venv
$(MAKE_VENV) -C docs html

docs-clean:
make -C docs clean
docs-clean: venv
$(MAKE_VENV) -C docs clean

# Publish docs: Push to a specific branch at the same origin.
# We have configured GitHub Pages to serve this branch,
Expand Down

0 comments on commit 23b8b81

Please sign in to comment.