Skip to content

Remove the sphinx.ext.githubpages extension (#566) #14

Remove the sphinx.ext.githubpages extension (#566)

Remove the sphinx.ext.githubpages extension (#566) #14

name: Update gh-pages documentation
on:
workflow_dispatch:
push:
branches: [main]
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'docs/requirements.txt'
- run: |
python -m pip install -r docs/requirements.txt
python -m pip install .
- run: |
python -m sphinx -b html -d docs/build/doctrees docs/source docs/build/html
- name: Check out gh-pages branch
run: |
git fetch --depth=1 origin gh-pages
git worktree add ../docs gh-pages
- name: Update the docs on the gh-pages branch
run: |
python docs/update_gh_pages.py docs/build/html ../docs
- name: Configure Git
run: |
git config user.name "Documentation Bot"
git config user.email "info@enthought.com"
- name: Commit the changes
run: |
cd ../docs
git add .
# Only commit if there are changes
git diff-index --quiet --cached HEAD || git commit -m "Automated update of main branch documentation"
- name: Push the changes upstream
run: |
git push origin gh-pages