Sphinx docs integration #5
This file contains hidden or 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_and_deploy_sphinx_docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - 'docs/**' | |
| jobs: | |
| build-docs: | |
| name: Build Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Fetch docs assets from media branch | |
| run: | | |
| git fetch origin media | |
| chmod +x docker/aic_docs/fetch_docs_assets.sh | |
| ./docker/aic_docs/fetch_docs_assets.sh media | |
| - name: Update image path | |
| run: | | |
| chmod +x docker/aic_docs/update_image_paths.sh | |
| ./docker/aic_docs/update_image_paths.sh | |
| - name: Setup python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.10" | |
| architecture: x64 | |
| - name: Install dev requirements | |
| working-directory: ./docker/aic_docs | |
| run: pip install -r requirements.txt | |
| - name: Check branch docs building | |
| working-directory: ./docs | |
| run: make html | |
| - name: Upload docs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-html | |
| path: ./docs/_build | |
| deploy-docs: | |
| name: Deploy Docs | |
| runs-on: ubuntu-latest | |
| needs: [build-docs] | |
| steps: | |
| - name: Download docs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs-html | |
| publish_dir: ./docs/_build/html | |
| - name: Deploy to gh-pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/_build/html |