Merge pull request #80 from adf-python/fix/docs/import #30
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: document | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- develop | |
paths: | |
- 'docs/**' | |
pull_request: | |
branches: | |
- main | |
- develop | |
paths: | |
- 'docs/**' | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Cache virtual environment | |
id: cached-virtualenv | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-virtualenv.outputs.cache-hit != 'true' | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Build documentation | |
run: | | |
source .venv/bin/activate | |
sphinx-apidoc -f -o ./docs/source ./adf_core_python | |
cd docs | |
make html | |
ls build/html | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/build/html |