-
Notifications
You must be signed in to change notification settings - Fork 16
73 lines (64 loc) · 2.36 KB
/
docs.yml
File metadata and controls
73 lines (64 loc) · 2.36 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
name: docs
permissions:
contents: read
pull-requests: write
on:
pull_request:
branches: [main]
types: [opened, synchronize, closed]
jobs:
build:
runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')) && fromJSON('["self-hosted", "db", "cyclops"]') || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4.2.2
with:
submodules: 'true'
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
with:
# Install a specific version of uv.
version: "0.7.20"
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --dev --group docs
- name: Install dependencies and check code
run: |
source .venv/bin/activate
pre-commit run --all-files
- name: Build docs
run: |
source .venv/bin/activate
cd docs
rm -rf source/reference/api/_autosummary
if [[ "${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') }}" == "true" ]]; then
make html-with-notebooks
else
make html
fi
- name: Set up Node.js
uses: actions/setup-node@v4.4.0
with:
node-version: 18
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Build webpage
run: |
cd docs/cyclops-webpage
yarn install --frozen-lockfile
yarn build
cp -r ../build/html build/api
- name: Create .nojekyll file
run: touch ./docs/cyclops-webpage/build/.nojekyll
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: github_pages
publish_dir: ./docs/cyclops-webpage/build
force_orphan: true