-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (91 loc) · 2.83 KB
/
Copy pathdocs.yaml
File metadata and controls
103 lines (91 loc) · 2.83 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
102
103
name: docs
# Build the Sphinx documentation and publish it to GitHub Pages.
# - On push to ``main`` and to release tags, the build *and* deploys.
# - On pull requests, the build runs (so doc changes are validated)
# but the deploy step is skipped.
#
# Repository setup required (one-time, in repo Settings → Pages):
#
# Build and deployment → Source: GitHub Actions
#
# After that, the latest run of this workflow becomes the live
# https://<owner>.github.io/<repo>/ site automatically.
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
# Allow only one concurrent deployment, and cancel in-progress runs
# instead of queuing them.
concurrency:
group: pages
cancel-in-progress: true
permissions:
contents: read # checkout
pages: write # deploy-pages
id-token: write # OIDC trust to deploy
jobs:
build:
name: build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# setuptools-scm needs the full tag history to compute the
# version, and sphinx may include version info in the docs.
fetch-depth: 0
- name: Setup Miniconda
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
condarc: |
channels:
- conda-forge
create-args: |
python=3.14
environment-name: ZCollection
environment-file: conda/environment.yml
- name: Stamp version
shell: bash -l {0}
run: |
python -m setuptools_scm
if [[ ! -e zcollection/version.py ]]; then
echo "__version__ = '$(git describe --tags --always)'" \
> zcollection/version.py
fi
- name: Install zcollection in the env
# sphinx-gallery executes the example files; they import
# ``zcollection`` and need it on the path.
shell: bash -l {0}
run: python -m pip install --no-deps -e .
- name: Build HTML
shell: bash -l {0}
run: python -m sphinx -b html docs/source docs/build/html
- name: Configure Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
deploy:
name: deploy
needs: build
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
environment:
# The ``github-pages`` environment is created automatically the
# first time this job runs successfully.
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4