forked from piskvorky/gensim
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (62 loc) · 2.21 KB
/
build-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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# This workflow rebuilds documentation and stores the resulting patch as a
# workflow artifact. We can then download the artifact, apply the patch, and
# then push the changes.
#
# It's possible to do all this locally on a developer's machine, but it's not
# trivial, because it requires many pre-requisites.
#
name: Rebuild documentation
on: workflow_dispatch
jobs:
docs:
name: Rebuild documentation
timeout-minutes: 180
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
#
# We use Py3.8 here for historical reasons.
#
python-version: "3.8"
- name: Update pip
run: python -m pip install -U pip
- name: Install apt packages for LaTeX rendering
run: |
sudo apt-get -yq update
sudo apt-get -yq remove texlive-binaries --purge
sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk
sudo apt-get -yq install build-essential python3.8-dev
- name: Install gensim and its dependencies
run: pip install -e .[docs]
- name: Build documentation
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