add GitHub Actions to run nb for generate html #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Jupyter Notebook and Generate HTML | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| execute_notebook: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| pip install notebook pandas matplotlib plotly nbconvert | |
| - name: Run Jupyter Notebook | |
| run: | | |
| jupyter nbconvert --to notebook --execute --inplace *.ipynb | |
| mkdir -p docs | |
| - name: Move HTML file | |
| run: | | |
| mv ./insurance_comparison.html ./docs/insurance_comparison.html | |
| - name: Commit and Push HTML file | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/insurance_comparison.html | |
| git commit -m "Auto-generated insurance comparison HTML" | |
| git push | |
| continue-on-error: true |