Repository navigation
66 lines (54 loc) · 1.58 KB
/
Copy pathexamples.yml
File metadata and controls
66 lines (54 loc) · 1.58 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
name: examples
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7
# Install dependencies
- name: Set up Python 3.12
uses: actions/setup-python@v7
with:
python-version: '3.12'
cache: pip
- name: Install mrpro and dependencies
run: |
pip install --index-url=https://download.pytorch.org/whl/cpu \
--extra-index-url https://pypi.org/simple/ \
--upgrade --upgrade-strategy eager -e .[dev]
# Build the book
- name: Build the book
run: jupyter-book build examples
# Upload the book's HTML as an artifact (useful for PR previews)
- name: Upload built HTML
uses: actions/upload-artifact@v7
with:
name: built-book
path: examples/_build/html
deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
steps:
- name: Download built HTML
uses: actions/download-artifact@v8
with:
name: built-book
path: examples/_build/html
# Upload to GitHub Pages
- name: Upload artifact for Pages
uses: actions/upload-pages-artifact@v5
with:
path: examples/_build/html
# Deploy the book's HTML to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5