-
Notifications
You must be signed in to change notification settings - Fork 3.1k
62 lines (48 loc) · 1.59 KB
/
update_documentation.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
# ---------------------------------------------------------
# Copyright (c) Recommenders contributors.
# Licensed under the MIT License.
# ---------------------------------------------------------
name: Update Documentation
on:
push:
branches:
- miguel/jupyter_book
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install --no-use-pep517 lightfm
pip install .[all]
pip install -r docs/requirements-doc.txt
- name: Build documentation
run: |
jupyter-book build docs
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Create and switch to gh-pages branch
run: |
git checkout -b gh-pages
git pull origin gh-pages || true
- name: Copy built documentation
run: cp -r docs/_build/html/* .
- name: Add and commit changes
run: |
git add * -f
git commit -m "Update documentation"
- name: Configure pull strategy (rebase)
run: git config pull.rebase true
- name: Pull latest changes from remote gh-pages branch
run: git pull -Xtheirs origin gh-pages
- name: Push changes to gh-pages
run: git push origin gh-pages