forked from facebookresearch/hiplot
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (92 loc) · 2.89 KB
/
docs.yml
File metadata and controls
112 lines (92 loc) · 2.89 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
name: Documentation
on:
push:
branches: [main]
workflow_dispatch:
# Allow only one concurrent deployment
concurrency:
group: pages
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build-js:
name: Build JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build production bundle
run: bun run build
- name: Upload JS bundle
uses: actions/upload-artifact@v6
with:
name: js-bundle
path: hiplot/static/built/
retention-days: 1
build-docs:
name: Build Documentation
needs: build-js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download JS bundle
uses: actions/download-artifact@v4
with:
name: js-bundle
path: hiplot/static/built/
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --no-default-groups --group docs
- name: Generate HiPlot demos
run: |
mkdir -p docs/_static/demo/
PAGES=$(uv run python -c "import hiplot.fetchers; print('\n'.join(list(hiplot.fetchers.README_DEMOS.keys())))")
for p in $PAGES; do
echo "Generating demo: $p"
uv run hiplot-render --format html $p > docs/_static/demo/$p.html
done
- name: Generate data demos
run: |
DATA_PATH="assets/data"
for p in $(ls $DATA_PATH); do
echo "Generating demo: $p"
uv run hiplot-render --format html $DATA_PATH/$p > docs/_static/demo/$p.html
done
- name: Generate HiPlot upload page
run: |
uv run python -c "from pathlib import Path; import hiplot; Path('docs/_static/hiplot_upload.html').write_text(hiplot.render.make_experiment_standalone_page({'dataProviderName': 'upload'}))"
cp -r hiplot/static docs/_static/static
cp hiplot/static/built/hiplot.bundle.js docs/_static/hiplot.bundle.js
- name: Build Sphinx docs
run: |
cd docs/
uv run make html
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs/_build/html
deploy:
name: Deploy to GitHub Pages
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4