How to Generate Catalog and Lineage in CI
dbt docs generate builds manifest.json and catalog.json, the inputs catalog and lineage tools consume.
Run dbt docs generate in CI to produce the manifest and catalog, then hand those artifacts to a lineage or catalog tool.
Steps
- Run
dbt docs generateafter a build. - Publish
manifest.jsonandcatalog.jsonas artifacts. - Feed them to a catalog or lineage tool (for example OpenLineage or a static docs site).
Workflow
.github/workflows/lineage.yml
on:
push:
branches: [main]
jobs:
lineage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install dbt-snowflake==1.8.0
- run: dbt docs generate --target prod
- uses: actions/upload-artifact@v4
with:
name: dbt-docs
path: |
target/manifest.json
target/catalog.json
target/index.htmlGotchas
catalog.jsonrequires warehouse access;docs generatequeries column metadata.- Column-level lineage needs the manifest compiled with the same models you deployed.
Related guides
How to Publish dbt Artifacts and Docs From CIGenerate dbt docs and upload manifest.json and catalog.json from CI so slim CI and lineage tools have a fresh…
How to Validate Data Contracts in CIEnforce data contracts in CI by linting the contract spec and checking that a producing model still matches i…