-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (63 loc) · 1.86 KB
/
docs.yaml
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
72
73
74
name: docs
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install docs requirements
run: |
pip install -r docs/requirements.txt
- name: Install
run: |
pushd geoarrow-pyarrow
pip install ".[test]"
popd
pushd geoarrow-pandas
pip install ".[test]"
popd
- name: Build docs
run: |
pushd docs
pandoc ../README.md --from markdown --to rst -s -o source/README_generated.rst
sphinx-build source _build/html
- name: Upload built documentation
uses: actions/upload-artifact@main
with:
name: docs
path: docs/_build/html
- name: Clone gh-pages branch
if: success() && github.repository == 'geoarrow/geoarrow-python' && github.ref == 'refs/heads/main'
uses: actions/checkout@v2
with:
ref: gh-pages
path: pages-clone
- name: Update development documentation
if: success() && github.repository == 'geoarrow/geoarrow-python' && github.ref == 'refs/heads/main'
env:
DOC_TAG: "main"
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
cd pages-clone
if [ -d "$DOC_TAG" ]; then
git rm -rf "$DOC_TAG"
fi
mkdir "$DOC_TAG"
cp -R ../docs/_build/html/* "$DOC_TAG"
git add *
git commit --allow-empty -m"update documentation for tag $DOC_TAG"
git push
cd ..