-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (61 loc) · 1.87 KB
/
Copy pathdeploy-docs.yaml
File metadata and controls
63 lines (61 loc) · 1.87 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
name: GitHub Pages
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python and uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
enable-cache: true
- name: Install Pandoc
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Install dependencies
run: |
uv sync --group dev --group notebooks
- name: Remove existing nb directory
run: |
if [ -d "docs/source/nb" ]; then
rm -rf docs/source/nb
fi
- name: Copy Notebook to docs
run: |
mkdir -p docs/source/nb
cp -r nb/. docs/source/nb/
- name: Build docs
run: |
cd docs
uv run make clean
uv run make html
# create distinguished subdirectories for each branch
# NOTE: force_orphan will delete all files in the branch (thus main & dev could not be concurrently deployed)
- name: Deploy docs main
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main')
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/build/html
publish_branch: gh-pages
- name: Deploy docs dev
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.base_ref == 'dev')
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/build/html
destination_dir: dev
publish_branch: gh-pages