Skip to content

remove debugging prints #77

remove debugging prints

remove debugging prints #77

Workflow file for this run

name: Sync example notebooks from main PGM repo to PGM-workshop
on:
push:
workflow_dispatch:
schedule:
- cron: "0 2 * * *" # Based on UTC time
jobs:
sync-files:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout PGM workshop repository
uses: actions/checkout@v4
with:
path: power-grid-model-workshop
- name: Checkout PGM Repository examples
uses: actions/checkout@v4
with:
repository: PowerGridModel/power-grid-model
ref: main
path: power-grid-model
sparse-checkout: docs/examples
sparse-checkout-cone-mode: false
- name: Move pgm examples to pgm workshop repository
run: |
ls power-grid-model-workshop
rm -rf power-grid-model-workshop/examples
mv power-grid-model/docs/examples power-grid-model-workshop
ls power-grid-model-workshop
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Python dependencies
run: pip install -r requirements.txt
working-directory: power-grid-model-workshop
- name: Use REs to replace links
run: sed -i 's|\.\./\(.*\)\.md|https://power-grid-model.readthedocs.io/en/stable/\1.html|g' *.ipynb
working-directory: power-grid-model-workshop/examples
- name: Run the notebooks
run: |
find examples -name "*.ipynb"| while IFS= read -r notebook; do
jupyter nbconvert --execute --allow-errors --inplace "$notebook"
done
working-directory: power-grid-model-workshop
- name: Commit and Push Changes to PGM workshop repository
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update the examples
repository: power-grid-model-workshop
commit_user_name: GitHub Actions Bot
commit_user_email: [email protected]
commit_author: GitHub Actions Bot <[email protected]>