-
Notifications
You must be signed in to change notification settings - Fork 7
101 lines (88 loc) · 3.27 KB
/
build_sphinx.yml
File metadata and controls
101 lines (88 loc) · 3.27 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: "Sphinx: Render docs"
on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "master"]
tags:
- 'v[0-9]*.*' # v1, v1.2, v1.2.3, v2025.09.04, etc.
- '[0-9]*\.[0-9]*\.*' # 1, 1.2, 1.2.3, 2025.09.04, etc.
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up micromamba (conda-forge + optional org channel)
uses: mamba-org/setup-micromamba@v2
with:
init-shell: bash
cache-downloads: true
environment-name: docs
# The python here should be coordinated with pyproj.toml.
# The others are a minimal set of things needed to bootstrap the build
# versions should be coordinated with pyproj.toml
create-args: >-
python=3.12
setuptools>=68
setuptools_scm
numpy>2
numpydoc
condarc: |
channel_priority: strict
channels:
- conda-forge
- cadwr-dms # keep if you publish your internal deps here
- name: Overlay current checkout (no pip deps and install bdschism)
env:
PIP_NO_INDEX: "1"
PIP_NO_BUILD_ISOLATION: "1"
SETUPTOOLS_SCM_ROOT: ${{ github.workspace }}
working-directory: ${{ github.workspace }}
run: |
micromamba run -n docs python -m pip install --upgrade pip
micromamba run -n docs python -m pip install ./bdschism --no-deps --no-build-isolation -v
- name: Install docs extras from pyproject via conda
run: |
micromamba run -n docs python scripts/install_docs_extras.py
- name: Build Sphinx
shell: bash -l {0}
env:
# flip to "0" if/when you want a full unmocked build
DOCS_USE_MOCKS: "0"
SETUPTOOLS_SCM_ROOT: ${{ github.workspace }}
run: |
sphinx-apidoc --force -T --templatedir ./_templates -o . ../bdschism ../bdschism/setup.py ../bdschism/tests/*
make -C docsrc clean
make -C docsrc html
# Upload the built site as a Pages artifact
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/html
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages # 👈 this resolves your 400 error
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4