-
-
Notifications
You must be signed in to change notification settings - Fork 27
73 lines (61 loc) · 2.13 KB
/
deploy-docs.yml
File metadata and controls
73 lines (61 loc) · 2.13 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: Deploy MyST Documentation to GitHub Pages
# This workflow deploys documentation for both stable and alpha releases
# Alpha releases: 0.13.0a1, 0.13.0a2, etc.
# Stable releases: 0.13.0, 0.14.0, etc.
on:
push:
branches:
- main # Or your default branch
permissions:
contents: read
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Match your project's Python version
- name: Cache Python dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install mystmd
- name: Generate DSL cheatsheet
run: |
echo "Generating DSL cheatsheet..."
python scripts/generate_dsl_cheatsheet.py
echo "✅ DSL cheatsheet generated successfully"
- name: Verify DSL cheatsheet was created
run: |
if [ ! -f "docs/_generated_dsl_cheatsheet.md" ]; then
echo "❌ Error: DSL cheatsheet was not generated"
exit 1
fi
echo "✅ DSL cheatsheet file exists"
- name: Clean previous build (if any)
run: rm -rf _build
- name: Build MyST documentation
run: |
echo "Building MyST documentation..."
# Explicitly set BASE_URL for correct asset path generation in subdirectories
BASE_URL=/attachments myst build --html
echo "✅ Documentation built successfully"
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _build/html/ # Path to the directory containing the built site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4