Automatically generate and update documentation using AI. Keeps your docs in sync with code changes.
name: Update Documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: inkloom-io/docs-action@v1
with:
api-key: ${{ secrets.INKLOOM_API_KEY }}
project-id: ${{ secrets.INKLOOM_PROJECT_ID }}
output: pr
auto-deploy: "true"
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}| Input | Required | Default | Description |
|---|---|---|---|
api-key |
Yes | — | InkLoom API key |
project-id |
Yes | — | InkLoom project ID |
openrouter-key |
No | — | OpenRouter API key (or set OPENROUTER_API_KEY env var) |
mode |
No | fast |
AI mode: extended (higher quality) or fast (faster) |
model |
No | — | AI model to use. Uses project default if empty. |
output |
No | pr |
Output mode: pr, branch, or direct |
auto-deploy |
No | true |
Auto-deploy to production on merge (pr/branch) or immediately (direct) |
docs-path |
No | docs |
Path to existing docs directory |
config-path |
No | .inkloom/docs.yml |
Path to config file |
description |
No | — | Product description (overrides config) |
budget |
No | — | Max budget in cents for AI generation |
| output | auto-deploy: true | auto-deploy: false |
|---|---|---|
pr |
Preview deploy on PR. Production deploy on merge. | Preview deploy on PR. Merge syncs to InkLoom, no production deploy. |
branch |
Preview deploy on MR. Production deploy on MR merge in InkLoom. | Preview deploy on MR. No production deploy. |
direct |
Push to InkLoom + production deploy immediately. | Push to InkLoom only. No deploy. |
Preview deploys and comments always happen for pr and branch modes.
| Output | Description |
|---|---|
pages-generated |
Number of pages generated or updated |
job-id |
InkLoom generation job ID |
preview-url |
Preview deployment URL |
cost-cents |
Estimated cost in cents |
pr-url |
URL of created PR (when output mode is pr) |
- Analyzes
git diffto find changed files - Filters through
.inkloom/docs.ymlscope patterns - If no doc-relevant changes, posts a comment and exits
- AI engine generates/updates documentation
- Commits docs to the PR branch
- Pushes pages to InkLoom and triggers preview deployment
- Posts a PR comment with results, cost summary, and preview link
- AI engine generates documentation for the full codebase
- Pages are pushed to InkLoom via the bulk API
- If
auto-deployis true, a production deployment is triggered
Create .inkloom/docs.yml in your repository root:
product:
description: "Short product description"
audience: public
scope:
include: ["src/**", "lib/**", "README.md"]
exclude: ["**/*.test.*", "vendor/**"]
ai:
mode: fast
max_pages: 50
action:
output: pr
autoDeploy: true- Use
mode: fast(default) for incremental updates — cheaper, faster - Use
mode: extendedfor comprehensive generation — higher quality, more expensive - Set a
budgetinput to cap spending per run - Use the
cost-centsoutput to track spending across runs
Add these secrets in your repository settings (Settings → Secrets and variables → Actions):
INKLOOM_API_KEY: Generate from your InkLoom project settings → API KeysINKLOOM_PROJECT_ID: Found in your InkLoom project URL or settingsOPENROUTER_API_KEY: Get from OpenRouter (or use InkLoom-managed credits)
MIT