-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (62 loc) · 2 KB
/
docs.yml
File metadata and controls
79 lines (62 loc) · 2 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
name: docs
on:
workflow_dispatch:
push:
branches:
- master
- feature/PROB-207-docs-as-subpage
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1️⃣ Checkout the repository
- uses: actions/checkout@v4
# 2️⃣ Set up Python
- uses: actions/setup-python@v6
with:
python-version: '3.11'
# 3️⃣ Install Poetry
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
working-directory: sources/Deltares.Probabilistic.Python
- name: Add Poetry to PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Show current pyproject.toml
run: cat sources/Deltares.Probabilistic.Python/pyproject.toml
# 4️⃣ Install Python dependencies
- name: Install Python dependencies
run: poetry install
working-directory: sources/Deltares.Probabilistic.Python
- name: Install Pandoc
run: sudo apt-get install -y pandoc # for ubuntu
# For Windows runners, you can use Chocolatey:
# choco install pandoc -y
# 5️⃣ Set up Node.js for Mermaid CLI
- uses: actions/setup-node@v3
with:
node-version: '20'
# 6️⃣ Install Mermaid CLI globally
- run: npm install -g @mermaid-js/mermaid-cli
# 7️⃣ Build Sphinx documentation
- name: Build Sphinx docs
run: |
poetry --directory sources/Deltares.Probabilistic.Python \
run sphinx-build -b html -a -E ../../web ../../web/build/html
# 8️⃣ Upload HTML docs as artifact for GitHub Pages
- uses: actions/upload-pages-artifact@v4
with:
path: web/build/html
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4