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 }}
target: ${{ github.event_name == 'push' && 'production' || 'preview' }}
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) |
target |
No | preview |
Deployment target: production or preview |
mode |
No | fast |
AI mode: extended (higher quality) or fast (faster) |
model |
No | — | AI model to use. Uses project default if empty. |
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 | 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 |
- 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
- 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:
pr:
enabled: true
comment: true
preview: true
push:
enabled: true
target: production
deploy: 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