Add workflow file to trigger paths #18
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 Documentation | |
| on: | |
| push: | |
| branches: [main, indev] | |
| paths: | |
| - '.github/workflows/docs.yml' | |
| - 'diive/**' | |
| - 'notebooks/**' | |
| - 'docs/**' | |
| - 'pyproject.toml' | |
| - 'poetry.lock' | |
| pull_request: | |
| branches: [main, indev] | |
| paths: | |
| - '.github/workflows/docs.yml' | |
| - 'diive/**' | |
| - 'notebooks/**' | |
| - 'docs/**' | |
| - 'pyproject.toml' | |
| - 'poetry.lock' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install poetry jupyter-book myst-parser sphinx sphinx-book-theme sphinx-autodoc-typehints | |
| - name: Install project | |
| run: | | |
| poetry install --only main | |
| - name: Build documentation | |
| run: | | |
| echo "Starting build..." | |
| jupyter-book build docs/source -v | |
| echo "Build complete, checking for output files..." | |
| ls -la docs/source/_build/html/ 2>&1 | head -20 | |
| find docs/source -name "*.html" -type f 2>&1 | head -10 | |
| - name: Deploy to GitHub Pages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/source/_build/html |