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_run.yml
- Enforces branch is up-to-date with main
- Installs dependencies and dbt packages
- 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
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
Optional - defaults to 'dune' if not set.
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, or reopened
- Changes to:
models/,macros/,dbt_project.yml,profiles.yml,packages.yml, workflow file
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.
- 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