name: API reference
on:
workflow_run:
workflows: ["Publish crate", "Node publish", "Publish Python package"]
types: [completed]
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: api-docs
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Python reference (pdoc, from the published package)
uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: |
python -m pip install --upgrade pip pdoc
python -m pip install --upgrade infino
pdoc infino -o site/python
- name: Node reference (TypeDoc, from the published package)
uses: actions/setup-node@v4
with:
node-version: "20"
- run: |
mkdir -p tsproj && cd tsproj
npm init -y >/dev/null
npm install @infino-ai/infino typedoc >/dev/null
npx typedoc --out ../site/node node_modules/@infino-ai/infino/infino/index.d.ts
- name: Landing page (links Python, Node, and Rust on docs.rs)
run: |
cat > site/index.html <<'HTML'
<!doctype html><html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Infino API reference</title>
<style>body{font:16px/1.5 system-ui,sans-serif;max-width:42rem;margin:4rem auto;padding:0 1rem}
a{color:#d24011}h1{font-size:1.6rem}li{margin:.5rem 0}</style></head>
<body><h1>Infino API reference</h1>
<p>Language API references for <a href="https://infino.ai/docs">Infino</a>.</p>
<ul>
<li><a href="./python/infino.html">Python</a> — <code>pip install infino</code></li>
<li><a href="./node/">Node.js</a> — <code>npm install @infino-ai/infino</code></li>
<li><a href="https://docs.rs/infino">Rust</a> — on docs.rs</li>
</ul></body></html>
HTML
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@v4