documentation.yaml: only create on master branch #99
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: | ||
- master | ||
permissions: | ||
contents: write | ||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# So we can find out the version information for the docs | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install recommonmark sphinx sphinx_rtd_theme sphinxcontrib.aafig | ||
# tbot dependencies | ||
pip install --user pytest mypy paramiko termcolor2 pyserial coverage pytest-cov | ||
# for unknown reasons termcolor2 get not found | ||
# but Install step shows, that it is installed | ||
export PYTHONPATH=/home/runner/.local/lib/python3.7/site-packages | ||
mkdir temp | ||
cd temp | ||
# set some git default values so git am works | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Heiko Schocher" | ||
../scripts/create_setup.sh | ||
- name: Sphinx build | ||
run: | | ||
CP=$(pwd) | ||
export PYTHONPATH=${CP}/temp/tbot:/home/runner/.local/lib/python3.7/site-packages | ||
cd temp/tbottest | ||
./Documentation/build-docs.sh | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./temp/tbottest/Documentation/output | ||
force_orphan: true |