Synphot paragrapph #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: sphinxdocumentation | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
#- name: Setup tmate session # Debugging | |
# uses: mxschmitt/action-tmate@v3 | |
- name: setup python | |
working-directory: ./ | |
run: | | |
pip install --upgrade pip | |
pip install ".[docs]" | |
- name: build doc tables | |
working-directory: ./doc | |
run: | | |
python pyphot_table.py | |
python licks_table.py | |
- name: sphinx-action@master | |
working-directory: ./doc | |
run: | | |
# clear previous API documentation | |
rm -f pyphot.rst pyphot.*.rst | |
# re-generate API documentation | |
make apidoc | |
# compile html | |
make html | |
# Publish built docs to gh-pages branch. | |
# =============================== | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages | |
cp -r doc/_build/html/* gh-pages/ | |
cd gh-pages | |
touch .nojekyll | |
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 | |
# that. | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
# =============================== |