Merge pull request #159 from ssciwr/pre-commit-ci-update-config #349
This file contains 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: Publish | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: publish-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
name: Publish webpages and jupyter slides | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- run: pip install uv | |
- run: uv pip install --system -r requirements.txt | |
- run: | | |
for filename in $(ls lunchtime*/*.ipynb) | |
do | |
if [ "$filename" != "lunchtime1/lunchtime1.ipynb" ]; then | |
# if conversion takes more than 90s, kill it and try again | |
# workaround for ipywidgets conversion occasionally hanging | |
until timeout 90s python -m jupyter nbconvert $filename --config jupyter_nbconvert_config.py; do sleep 1; done | |
fi | |
done | |
- run: mv README.md lunchtime* dist/. | |
- uses: JamesIves/github-pages-deploy-action@v4 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
name: Deploy to gh-pages | |
with: | |
branch: gh-pages | |
folder: dist | |
single-commit: true |