Update sphinx-build.yml #44
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: Update Documentation | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Generate HTML files | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install pipenv | |
run: | | |
python -m pip install --upgrade pipenv wheel | |
- id: cache-pipenv | |
uses: actions/cache@v1 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | |
- name: Install dependencies | |
if: steps.cache-pipenv.outputs.cache-hit != 'true' | |
run: | | |
pipenv install --deploy --dev | |
- name: Make | |
run: | | |
pipenv run make html | |
# 2. Add and commit HTML files to gh-pages branch | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/open-ephys/acq-board-docs.git --branch gh-pages --single-branch gh-pages | |
cd gh-pages | |
rm -rf * | |
cp -r ../docs/html/* . | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation" -a || true | |
# 3. Push changes to gh-pages branch (updates documentation page) | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |