-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (45 loc) · 1.34 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
name: Build documentation
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
sudo apt-get install pandoc
python -m pip install --upgrade pip
pip install gsw numpy netCDF4 matplotlib Sphinx jupyter myst-parser sphinx-rtd-theme
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build documentation
run: |
sphinx-build docs docs/_build/html
- name: Clone gh-pages branch
if: success() && (github.ref == 'refs/heads/main')
uses: actions/checkout@main
with:
ref: gh-pages
path: pages-clone
- name: Update documentation
if: success() && (github.ref == 'refs/heads/main')
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
cd pages-clone
git rm -rf .
cp -R ../docs/_build/html/* .
touch .nojekyll
git add .nojekyll
git add *
git commit --allow-empty -m"update documentation"
git push