Update run_nb.yml #3
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: Commit and Push HTML file | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| 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" || echo "No changes to commit" | |
| git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git main | |
| git add docs/insurance_comparison.html | |
| git commit -m "Auto-generated insurance comparison HTML" | |
| git push | |
| continue-on-error: true |