Skip to content

Build And Publish Python API Docs #4

Build And Publish Python API Docs

Build And Publish Python API Docs #4

name: Build And Publish Python API Docs
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build-api-docs:
name: "Build bdkpython API docs"
runs-on: ubuntu-24.04
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
fetch-depth: 0
- name: "Configure Git safe directory"
run: git config --global --add safe.directory /__w/bdk-python/bdk-python
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: "Set up Rust"
uses: actions-rust-lang/[email protected]
with:
cache: true
rust-src-dir: ${{ github.workspace }}/bdk-ffi/bdk-ffi
- name: "Generate bdk.py"
env:
PYBIN: ${{ env.pythonLocation }}/bin
run: bash ./scripts/generate-linux.sh
- name: "Install Sphinx and Theme"
run: pip3 install sphinx sphinx_rtd_theme
- name: "Generate python API Documentation"
run: python3 ./docs/generate_docs.py
- name: "Build HTML Documentation"
run: python3 -m sphinx -b html -W --keep-going docs/source docs/_build/html
- name: "Upload API Docs"
uses: actions/upload-artifact@v4
with:
name: artifact-bdkpython-api-docs
path: docs/_build/html
- name: "Upload API Docs for GitHub Pages"
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html
deploy-api-docs:
name: "Deploy bdkpython API docs on GitHub Pages"
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
needs: build-api-docs
steps:
- name: "Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@v4