Skip to content

Commit eeefcd0

Browse files
add GitHub Actions to run nb for generate html
1 parent 6a9eec8 commit eeefcd0

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/run_nb.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Jupyter Notebook and Generate HTML
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
execute_notebook:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.10'
21+
22+
- name: Install dependencies
23+
run: |
24+
pip install notebook pandas matplotlib plotly nbconvert
25+
26+
- name: Run Jupyter Notebook
27+
run: |
28+
jupyter nbconvert --to notebook --execute --inplace *.ipynb
29+
mkdir -p docs
30+
31+
- name: Move HTML file
32+
run: |
33+
mv ./insurance_comparison.html ./docs/insurance_comparison.html
34+
35+
- name: Commit and Push HTML file
36+
run: |
37+
git config --global user.name "github-actions[bot]"
38+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
39+
git add docs/insurance_comparison.html
40+
git commit -m "Auto-generated insurance comparison HTML"
41+
git push
42+
continue-on-error: true

0 commit comments

Comments
 (0)