Skip to content

Commit

Permalink
Upload the changes to the generated docs to GitHub artifacts
Browse files Browse the repository at this point in the history
Building the docs often takes too long locally, so this allows
pull request submitters to build on GitHub, download the changes
and incorporate the changes to the generated docs in a commit,
then update their pull request with the generated docs commit.

Also check that the changes to the prebuilt docs are committed,
except for docs that change for every single rebuild.
  • Loading branch information
pabs3 committed Mar 19, 2023
1 parent 5ff6b45 commit 57cb684
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ jobs:
run: |
python setup.py build_ext --inplace
make -C docs/src clean html
- name: Check changes to prebuilt docs
run: |
git config user.email "[email protected]"
git config user.name "Gensim Docs Build"
if ! git diff --quiet @ ; then
git add .
branch="$GITHUB_HEAD_REF ($GITHUB_REF_NAME)"
git commit -m "Import rebuilt documentation for branch $branch"
git format-patch @^
git bundle create prebuilt-docs-changes.bundle @^...@
git reset --mixed @^
git diff --exit-code --stat @
fi
- name: Upload prebuilt docs changes
if: always()
uses: actions/upload-artifact@v3
with:
name: prebuilt-docs-changes
path: |
*.patch
*.bundle
#
# FIXME: do we want to store the built documentation somewhere, or is
# knowing that the docs built successfully enough?
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ data
*.inv
*.js
docs/_images/
docs/_downloads/

#
# Generated by Cython
Expand Down

0 comments on commit 57cb684

Please sign in to comment.