Repository navigation
62 lines (55 loc) · 2.02 KB
/
Copy pathdocs_deploy.yml
File metadata and controls
62 lines (55 loc) · 2.02 KB
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
name: Deploy Documentation
on:
push:
branches:
- main
# Optional: manual trigger
workflow_dispatch:
jobs:
deploy-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v3
with:
environment-file: docs/environment.yml
init-shell: bash
condarc: |
channels:
- conda-forge
channel_priority: strict
cache-environment: true
- name: Install package (editable)
shell: bash -l {0}
run: |
micromamba run -n oceanarray python -m pip install --upgrade pip
micromamba run -n oceanarray python -m pip install -e ".[dev]" --force-reinstall
- name: Build documentation
shell: bash -l {0}
run: |
set -e
micromamba run -n oceanarray jupyter nbconvert --to notebook --execute notebooks/demo_mooring.ipynb --output=demo_mooring-output.ipynb
mv notebooks/*output.ipynb docs/source/
pushd docs
micromamba run -n oceanarray make clean html
popd
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
# Optional: publish_branch: gh-pages
# Optional: cname: docs.example.org
# Replace gh-pages with a single commit each deploy. The built site is
# regenerable, so its history has no value. The saving is smaller than it
# looks: git deltas near-identical HTML well, and squashing 70-120 deploys
# shrinks a fresh clone by only 4-18%. What it does bound is the growth from
# re-executed demo notebooks, whose embedded PNGs differ every build and so
# never delta. Current site size dominates, not history - keep _static small.
force_orphan: true