Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: apidocs
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@master
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install requirements for documentation generation
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install pydoctor

- name: Generate documentation with pydoctor
run: |

# Run pydoctor build
pydoctor \
--project-name='KeyFactor API Client V1' \
--project-url=https://github.com/$GITHUB_REPOSITORY \
--html-viewsource-base=https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA \
--html-base-url=https://$GITHUB_REPOSITORY_OWNER.github.io/${GITHUB_REPOSITORY#*/} \
--html-output=./www \
--docformat=google \
--intersphinx=https://docs.python.org/3/objects.inv \
./kfclient/keyfactor_v_1_client

- name: Push API documentation to Github Pages (if on main branch)
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www
commit_message: "Generate documentation"