forked from Deltares/GEOLib
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (62 loc) · 2.01 KB
/
CI-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
69
70
71
name: ci-docs
on:
push:
branches:
- master
jobs:
Docs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.2.2
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
key: venv--${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv--${{ matrix.os }}-${{ matrix.python-version }}-
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: poetry install -E server
- name: Build sphinx documentation
run: |
cd docs
poetry run python -m sphinx . build -b html -c .
- name: Commit documentation changes
run: |
git clone https://github.com/Deltares/GEOLib.git --branch gh-pages --single-branch gh-pages
rm -r -f gh-pages/dev
mkdir gh-pages/dev
cp -r docs/build/* gh-pages/dev
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update dev version documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}