Merge pull request #235 from knaaptime/builddocs #51
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: Build Docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
docs: | |
name: Build & Push Docs | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 90 | |
strategy: | |
matrix: | |
os: ['ubuntu-latest'] | |
environment-file: [ci/312.yml] | |
experimental: [false] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags. | |
- name: Setup micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ${{ matrix.environment-file }} | |
micromamba-version: 'latest' | |
- name: Install | |
run: pip install -e . --no-deps --force-reinstall | |
- name: Make Docs | |
run: cd docs; make html | |
- name: Commit Docs | |
run: | | |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages | |
cp -r docs/_build/html/* gh-pages/ | |
cd gh-pages | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation" -a || true | |
# The above command will fail if no changes were present, | |
# so we ignore the return code. | |
- name: Push to gh-pages | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true |