-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (53 loc) · 1.54 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
name: docs
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- '.github/workflows/docs.yaml'
- 'ci/scripts/build-docs.sh'
- 'docker-compose.yml'
- 'src/**'
- 'docs/source/**'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build documentation
run: |
echo "::group::Docker Pull"
docker compose run --rm -e GITHUB_ACTIONS docs
- name: Upload built documentation
uses: actions/upload-artifact@main
with:
name: geoarrow-docs
path: docs/_build/html
- name: Clone gh-pages branch
if: success() && github.repository == 'geoarrow/geoarrow-c' && 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-c' && github.ref == 'refs/heads/main'
env:
DOC_TAG: "dev"
run: |
git config --global user.email "[email protected]"
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"
touch .nojekyll
git add .nojekyll
git add *
git commit --allow-empty -m"update documentation for tag $DOC_TAG"
git push
cd ..