2022 #136
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, pull_request, workflow_dispatch] | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install sphinx==6.1.3 sphinx_rtd_theme sphinx-favicon myst_parser sphinx_sitemap | |
- name: Sphinx build | |
run: | | |
sphinx-build -W --keep-going doc _build | |
if [ $? -ne 0 ]; then | |
echo -e "\033[1;31mSphinx build FAILED\033[0m\n" | |
exit 1 | |
else | |
echo -e "\033[1;32mSphinx build PASSED\033[0m\n" | |
fi | |
- name: Set branch name | |
id: branch | |
run: echo "SUBDIR_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Deploy | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/ | |
destination_dir: ${{ env.SUBDIR_NAME }} | |
full_commit_message: Deploy documentation of '${{ env.SUBDIR_NAME }}' to GitHub Pages |