Skip to content

Improve SDK documentation and usage guides #4

Improve SDK documentation and usage guides

Improve SDK documentation and usage guides #4

name: unified-deployment
on:
workflow_dispatch:
push:
branches: ["main"]
paths:
- "docs/**"
- "mkdocs.yml"
- "hovercode/**"
- "pyproject.toml"
release:
types: [published]
permissions:
contents: read
pages: write
id-token: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install docs deps
run: python -m pip install --upgrade pip && python -m pip install -e ".[docs]"
- name: Build docs
run: mkdocs build --strict
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy-pages:
needs: docs
if: ${{ vars.ENABLE_GITHUB_PAGES == 'true' }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
publish:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build package
run: python -m pip install --upgrade pip && python -m pip install build twine && python -m build
- name: Twine check
run: python -m twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: python -m twine upload dist/*