Skip to content

Commit 32ce835

Browse files
update workflow rendering html
1 parent fe45e97 commit 32ce835

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/render-notebook.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
- main
77
paths:
88
- 'notebooks/tutorial_few_shot_learning.ipynb'
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- 'notebooks/tutorial_few_shot_learning.ipynb'
914
workflow_dispatch:
1015

1116
permissions:
@@ -14,6 +19,7 @@ permissions:
1419
jobs:
1520
render:
1621
runs-on: ubuntu-latest
22+
1723
steps:
1824
- name: Checkout
1925
uses: actions/checkout@v4
@@ -30,9 +36,15 @@ jobs:
3036
3137
- name: Convert notebook to HTML
3238
run: |
33-
jupyter nbconvert --to html notebooks/tutorial_few_shot_learning.ipynb --output-dir docs/
39+
jupyter nbconvert \
40+
--to html \
41+
notebooks/tutorial_few_shot_learning.ipynb \
42+
--output tutorial_few_shot_learning.html \
43+
--output-dir docs/
3444
45+
# Only commit on push to main, NOT on PRs
3546
- name: Commit rendered HTML
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
3648
run: |
3749
git config --local user.email "github-actions[bot]@users.noreply.github.com"
3850
git config --local user.name "github-actions[bot]"

0 commit comments

Comments
 (0)