Initial Commit #82
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_pages_workflow | |
# Execute this workflow automatically when a push is made to the trunk branch | |
on: | |
push: | |
branches: [ trunk ] | |
jobs: | |
build_docs_job: | |
runs-on: ubuntu-latest | |
environment: PRODUCTION | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
python -m pip install -U sphinx==7.3.7 | |
python -m pip install sphinx-book-theme==1.1.3 | |
- name: Build the Sphinx docs | |
env: | |
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
TEST_CHAT_URL: ${{ secrets.TEST_CHAT_URL }} | |
run: | | |
# Navigate to the Sphinx documentation directory | |
cd docs || exit | |
# Remove old .rst files | |
rm source/*.rst | |
# But keep the index.rst file | |
git restore source/index.rst | |
# Build the docs .rst files | |
sphinx-apidoc -o source/ ../ | |
# Build the Sphinx documentation | |
make html | |
- name: Verify the Sphinx docs build | |
run: | | |
if [ ! -f docs/build/html/index.html ]; then | |
echo "Documentation build failed" | |
exit 1 | |
fi | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/build/html | |
force_orphan: true |