-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.28 KB
/
renderJupyter.yaml
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
# Github action that runs all jupyter notebook after pull request
# Jupyter notebooks will be run in the container/jupyter.Dockerfile
name: render-jupyter-notebook
on:
pull_request:
types:
- opened
- reopened
- edited
push:
jobs:
run_notebooks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
file: container/jupyter.Dockerfile
context: .
push: false # Set to true if you want to push the image to a registry
tags: notebook-runner
- name: Run Docker container to compile JupyterNotebook
uses: addnab/docker-run-action@v3
with:
image: notebook-runner
options: -v ${{ github.workspace }}:/workspace --rm -u root
run: |
notebooks=$(find /workspace -name "*.ipynb")
if [ -n "$notebooks" ]; then
find /workspace -name "*.ipynb" -exec jupyter nbconvert --to html --execute {} \;
find /workspace -name "*.ipynb" -exec jupyter nbconvert --to markdown --execute {} \;
else
echo "No Jupyter notebooks found. Skipping execution."
fi
- uses: stefanzweifel/git-auto-commit-action@v5