Minor refactoring to simplify observer structures (#192) #373
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: Update the gh-pages branch | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
build-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install documentation dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[doc] | |
- name: Build Sphinx documentation | |
run: | | |
sphinx-build -b html docs/source docs/build/html | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/Aalto-Electric-Drives/motulator.git --branch gh-pages --single-branch gh-pages | |
mkdir -p gh-pages/docs | |
rm -rf gh-pages/docs/* | |
cp -r docs/build/html/* gh-pages/docs | |
cd gh-pages | |
touch docs/.nojekyll | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation" -a || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |