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: Deploy Sphinx documentation to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r docs/requirements.txt | |
| pip install -e . | |
| - name: Debug workspace | |
| run: | | |
| echo "Current directory: $(pwd)" | |
| echo "Contents of current directory:" | |
| ls -la | |
| echo "Contents of docs directory:" | |
| ls -la docs/ | |
| echo "Contents of docs/source directory:" | |
| ls -la docs/source/ | |
| - name: Build documentation | |
| run: | | |
| # Create build directory if it doesn't exist | |
| mkdir -p docs/build/html | |
| # Build from the repository root using full paths | |
| sphinx-build -b html docs/source docs/build/html -v | |
| - name: Create .nojekyll file | |
| run: | | |
| touch docs/build/html/.nojekyll | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/build/html | |
| # Deployment job | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/main' | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |