Repository navigation
119 lines (99 loc) · 3.05 KB
/
Copy pathdocpages.yml
File metadata and controls
119 lines (99 loc) · 3.05 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Build the Fumadocs site under docs/ and deploy it to GitHub Pages
name: Documentation
# specify which events will trigger this workflow
on:
# run on all pushed to main
push:
branches:
- main
# PRs trigger for the "opened", "reopened", "synchronize" events (default) and
# "ready_for_review"
pull_request:
types:
- opened
- reopened
- synchronize # when new commits are pushed to the PR
- ready_for_review # when the PR is un-drafted
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
COLUMNS: 120
FORCE_COLOR: 3
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
env:
# The site is served from algorithmiq.github.io/src-method.
NEXT_PUBLIC_BASE_PATH: /src-method
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# grab the history, so hatch-vcs can compute the version number
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.14"
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
run: |
uv sync --no-dev --group docs
npm ci
- name: Get src_method version
run: |
uv run --no-sync python -c "import src_method; print(src_method.__version__)"
- name: Generate the API reference
run: |
uv run --no-sync python scripts/gen_api_dump.py src_method -d .
node scripts/generate-api.mjs
- name: Run the examples in the prose pages
working-directory: .
run: >-
uv run --no-sync python -m pytest --markdown-docs -p no:cacheprovider
docs/content/docs
--ignore=docs/content/docs/api
--ignore=docs/content/docs/tutorials
- name: Execute the tutorial notebooks
run: |
uv run --no-sync python scripts/notebooks_to_mdx.py
- name: Build the static site
run: |
npm run build
- name: Setup Pages
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/configure-pages@v6
- name: Upload artifact
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-pages-artifact@v5
with:
path: docs/out
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5