update action #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 docs | |
| on: | |
| push: | |
| branches: [ main, feat/docs ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install doc deps | |
| run: | | |
| if [ -f docs/requirements.txt ]; then | |
| pip install -r docs/requirements.txt | |
| else | |
| pip install sphinx myst-parser sphinx-rtd-theme sphinx-autodoc-typehints sphinx-copybutton | |
| fi | |
| - name: Install package | |
| run: | | |
| pip install -e . | |
| - name: Sanity check package discovery | |
| run: | | |
| python - <<'PY' | |
| import pkgutil, pygip | |
| print("pygip is at:", pygip.__file__) | |
| print("submodules:", [m.name for m in pkgutil.walk_packages(pygip.__path__, pygip.__name__ + ".") if m.name.startswith("pygip.models")]) | |
| PY | |
| - name: Build Sphinx html | |
| run: | | |
| sphinx-build -b html docs/source docs/build/html | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/build/html | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |