Skip to content

Sync example notebooks from main PGM repo to PGM-workshop #10

Sync example notebooks from main PGM repo to PGM-workshop

Sync example notebooks from main PGM repo to PGM-workshop #10

Workflow file for this run

name: Sync example notebooks from main PGM repo to PGM-workshop
on:
push:
branches:
- sync-examples-workflow
workflow_dispatch:
schedule:
- cron: "32 14 * * *" # Based on UTC time
jobs:
sync-files:
runs-on: ubuntu-latest
steps:
- name: Checkout PGM workshop repository
uses: actions/checkout@v4
- name: Checkout PGM Repository
uses: actions/checkout@v4
with:
repository: PowerGridModel/power-grid-model
ref: main
- name: Copy Files
run: |
cp -r docs/examples $GITHUB_WORKSPACE
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Python dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run the notebooks
run: |
source venv/bin/activate
jupyter nbconvert --to notebook --execute $GITHUB_WORKSPACE
- name: Commit and Push Changes to PGM workshop repository
run: |
git config user.name 'GitHub Action'
git config user.email '[email protected]'
git add .
if git diff-index --quiet HEAD; then
echo "No changes detected."
else
git commit -m "Update PGM examples"
git push