Continuous integration and deployment via GitHub Actions.
This template uses GitHub-hosted runners (ubuntu-latest) to execute CI/CD workflows.
GitHub provides and manages these runners - no infrastructure setup required on your end.
Trigger: Every pull request
File: .github/workflows/dbt_ci.yml
- Runs on every pull request affecting dbt project paths (or manual dispatch)
- Installs dependencies and dbt packages
- Compiles project and compares against main manifest
- Runs modified models with
--full-refresh - Tests modified models
- Runs modified incremental models (incremental run)
- Tests modified incremental models again
Each PR gets its own isolated schema:
{team}__tmp_pr{number}
Example: dune__tmp_pr123
This is set via DEV_SCHEMA_SUFFIX=pr{number} environment variable.
✅ Keep branch updated:
git fetch origin
git merge origin/main
git push✅ Test locally before pushing:
uv run dbt run --select modified_model --full-refresh
uv run dbt test --select modified_model✅ Fix failing tests - Don't skip tests or disable checks
The Dune integration CI runs on matching PR changes, so monitor credit usage:
- Keep the quality workflow (
dbt_quality.yml) as a zero-credit static validation baseline - Use
state:modifiedin CI (already configured) to limit heavy runs to changed models - Use path filters to avoid triggering on irrelevant repository changes
Trigger: Manual (schedule disabled by default)
File: .github/workflows/dbt_prod.yml
Branch: main only
- Downloads previous manifest (if exists)
- If state exists: Runs modified models with
--full-refreshand tests - Runs all models (handles incremental logic automatically)
- Tests all models
- Uploads manifest for next run
- Sends email notification on failure
The workflow saves manifest.json after each run and downloads it next time to detect changes.
- Modified models get full refresh
- Unchanged incremental models run incrementally
- Manifest expires after 90 days
Production runs use DBT_TARGET=prod:
- Writes to
{team}schemas (production) - No suffix applied
DUNE_API_KEY=your_api_key
DUNE_TEAM_NAME=your_team_name
This variable is required for deploy/prod/CI workflows.
Trigger: Every pull request affecting dbt project files
File: .github/workflows/dbt_quality.yml
This workflow does not require DUNE_API_KEY and runs only static project checks:
uv sync --lockeduv run dbt depsuv run dbt parse --no-partial-parse
Use this as the mandatory baseline check for every PR.
To receive failure alerts:
-
Enable notifications: Profile → Settings → Notifications → Actions → "Notify me for failed workflows only"
-
Verify email address in GitHub settings
-
Watch repository: Click "Watch" button (any level works, even "Participating and @mentions")
Runs when:
- PR opened, synchronized, reopened, or marked ready for review
- Changes to:
models/,macros/,tests/,dbt_project.yml,profiles.yml,packages.yml, workflow file
To block merges unless CI passes:
- Go to GitHub → Repository Settings → Branches
- Edit the protection rule for
main - Enable Require status checks to pass before merging
- Mark these checks as required:
parse(fromdbt quality)dbt-ci(fromdbt CI)
Runs when:
- Hourly (cron:
'0 * * * *') - disabled by default, must be uncommented - Manual trigger via GitHub Actions UI
git fetch origin
git merge origin/main
git pushCheck test output in GitHub Actions logs:
dbt test output → specific test name → error message
Query the model in Dune to investigate.
PR Dune CI depends on prod-manifest-latest uploaded by deploy workflow.
If CI fails with missing manifest:
- Go to Actions →
dbt deploy - Run workflow on
main - Wait for completion (artifact upload)
- Re-run PR check
- Verify
DUNE_API_KEYsecret is set correctly - Check Dune API status
Workflows timeout after 30 minutes. If hitting this:
- Optimize query performance
- Add date filters during development
- Consider breaking large models into smaller pieces
Go to Actions tab → "dbt prod orchestration" → "Run workflow"
Use this for:
- Testing deployment changes
- Forcing a full refresh
- Running outside normal schedule
- Development Workflow - Local development process
- Testing - Test requirements
- Troubleshooting - Common issues