forked from hertie-dsl-interim-backup/hertie-school-deep-learning-fall-2025-tutorial-new-deep-learning-2025-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (49 loc) · 1.46 KB
/
render-notebook.yml
File metadata and controls
57 lines (49 loc) · 1.46 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
name: Render Notebook to HTML
on:
push:
branches:
- main
paths:
- 'notebooks/tutorial_few_shot_learning.ipynb'
pull_request:
branches:
- main
paths:
- 'notebooks/tutorial_few_shot_learning.ipynb'
workflow_dispatch:
permissions:
contents: write
jobs:
render:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install nbconvert jupyter
- name: Convert notebook to HTML
run: |
jupyter nbconvert \
--to html \
notebooks/tutorial_few_shot_learning.ipynb \
--output tutorial_few_shot_learning.html \
--output-dir docs/
# Only commit on push to main, NOT on PRs
- name: Commit rendered HTML
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/tutorial_few_shot_learning.html
if ! git diff --staged --quiet; then
git commit -m "Auto-render notebook to HTML [skip ci]"
git push
else
echo "No changes to commit"
fi