Merge pull request #92 from flatironinstitute/docs/sphinx-gallery #7
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
name: docs | |
on: | |
push: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Check out github | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies and package | |
run: | | |
python -m pip install --upgrade pip wheel | |
python -m pip install --upgrade -r docs/requirements.txt | |
python -m pip install . | |
- name: Build docs | |
run: | | |
cd docs/ | |
make clean | |
make html | |
- name: Check out github | |
uses: actions/checkout@v4 | |
with: | |
path: docs/_build/pyt-fnft-docs | |
ref: gh-pages | |
- name: Commit html docs | |
run: | | |
cd docs/_build/ | |
ls | |
rm -rf pyt-fnft-docs/* | |
cp -r html/. pyt-fnft-docs/ | |
cd pyt-fnft-docs/ | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit --amend -m "Rebuild docs" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: docs/_build/pyt-fnft-docs | |
force: true |