generated from ssciwr/jupyter-slides-template
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.26 KB
/
publish.yml
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
name: Publish
on: push
jobs:
publish:
name: Publish reveal.js slides
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install -r requirements.txt
- run: sudo apt update -qy && sudo apt install ffmpeg -qy
- run: jupyter nbconvert *.ipynb --to slides --execute
- run: |
for filename in $(ls *.ipynb)
do
jupyter nbconvert --execute --to slides $filename --post serve &
sleep 30
base="$(basename $filename .ipynb)"
pdf="${base}.pdf"
webpage="http://127.0.0.1:8000/${base}.slides.html/?print-pdf"
echo "$webpage -> $pdf"
google-chrome --headless --print-to-pdf=$pdf $webpage
killall jupyter-nbconvert
sleep 10
done
- run: mv *.slides.html *.pdf dist/. && mv dist/index.slides.html dist/index.html
- uses: JamesIves/[email protected]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy to gh-pages
with:
branch: gh-pages
folder: dist
single-commit: true