From 75ba0ecec8031b03b9f33ee1d5f4bf66de94fd54 Mon Sep 17 00:00:00 2001 From: tristanlatr <19967168+tristanlatr@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:49:57 -0400 Subject: [PATCH] Create docs.yml --- .github/workflows/docs.yml | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8fc7ebf --- /dev/null +++ b/.github/workflows/docs.yml @@ -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"