-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (54 loc) · 1.55 KB
/
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
name: Docs
on:
release:
types:
- published
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
docs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: clouddrift
- name: Build docs
shell: bash -l {0}
run: |
python -m pip install build twine docutils
python -m build
pip install dist/*.whl
pushd docs
pip install clouddrift[docs]
make html
- name: Upload HTML artificat
uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/_build/html/
- name: Commit to gh-pages
run: |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
touch .nojekyll
echo clouddrift.org > CNAME
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
force: true