Update Docs #3
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 Docs | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'mpython/**' | |
- '.github/workflows/update-docs.yml' | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pdoc3 numpy | |
- name: Generate docs | |
run: | | |
rm -rf docs | |
mkdir -p docs | |
pdoc3 --html mpython --output-dir docs --force | |
mv docs/mpython/* docs/ | |
rmdir docs/mpython | |
- name: Commit and push changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add docs | |
git commit -m "[Doc] Regenerate" || echo "No changes to commit" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |