Sync example notebooks from main PGM repo to PGM-workshop #484
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
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected]> | |
# | |
# SPDX-License-Identifier: MPL-2.0 | |
name: Sync example notebooks from main PGM repo to PGM-workshop | |
on: | |
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: | | |
rm -rf power-grid-model-workshop/examples | |
mv power-grid-model/docs/examples 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: 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_options: '--signoff' | |
commit_user_name: GitHub Actions Bot | |
commit_user_email: [email protected] | |
commit_author: GitHub Actions Bot <[email protected]> |