-
Notifications
You must be signed in to change notification settings - Fork 9
78 lines (69 loc) · 2.12 KB
/
_release-docs.yml
File metadata and controls
78 lines (69 loc) · 2.12 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
name: Build and Deploy Docs
on:
workflow_call:
inputs:
project:
description: 'Name of the project to test'
default: 'PROJECT_NAME'
required: false
type: string
python_version:
description: 'Python version to use for building documentation'
required: true
type: number
c_extension:
description: 'Whether the project has a C extension'
default: false
required: false
type: boolean
headless:
description: 'Whether to run headless tests'
default: false
required: false
type: boolean
jobs:
build-deploy:
defaults:
run:
shell: bash -l {0}
runs-on: ubuntu-latest
steps:
- name: Check out ${{ inputs.project }}
uses: actions/checkout@v6
with:
ref: ${{ github.ref }}
- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
channels: conda-forge
auto-update-conda: true
auto-activate-base: false
python-version: ${{ inputs.python_version }}
- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no
- name: Install ${{ inputs.project }} and docs requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/docs.txt
if ${{ inputs.c_extension }}; then
conda install --file requirements/build.txt
fi
# Install the project in editable mode in order for
# sphinx to grab api from extension files
python -m pip install -e . --no-deps
- name: Start Xvfb
if: ${{ inputs.headless }}
run: |
sudo apt-get install -y xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &
- name: build documents
run: make -C docs html
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html