Deployment¶
Course map · Previous: Documentation · Next: Next steps after Fundamentals

The course deploys with dbt Cloud jobs. This repo uses a GitHub Action instead: .github/workflows/dbt.yml loads the raw data and runs dbt build on every pull request, so a broken model or failing test shows a red check before anyone merges.
| Open | Run |
|---|---|
.github/workflows/dbt.yml |
runs on every pull request |
Learn¶
- Development: you change the project on a branch (for example
feature/customers-model) and build into your own schema (for exampledbt_jsmith), so you never touch what others use. - Deployment: dbt runs on a schedule from
maininto a production schema (for exampledbt_prod), and dashboards read from there. Production gets its own schema and, ideally, its own warehouse account.
In dbt Cloud you set this up on two pages. Environments picks the dbt version, branch and credentials. Jobs runs commands such as dbt build on a schedule or with Run Now, and keeps each run's logs and docs.
This repo uses a GitHub Action instead, so every pull request is checked before it reaches main.
Quiz¶
What runs dbt build on every pull request in this repo?
- A dbt Cloud job
- A cron job on a server
- The GitHub Action in
.github/workflows/dbt.yml
Answer
The GitHub Action. It loads the raw data, then runs dbt deps and dbt build. A failing model or test shows a red check on the pull request.
Why does CI run on the DuckDB target?
- DuckDB needs no warehouse or secrets, so CI works on every fork
- Snowflake can't run in GitHub Actions
- DuckDB gives different results, which CI needs
Answer
No secrets needed. The same models and tests run on both targets. DuckDB lets any fork get CI without a Snowflake login.
Which schema should production runs write to?
- Your own development schema, such as
dbt_jsmith - A dedicated schema no developer uses, such as
dbt_prod - Whichever schema the last developer used
Answer
A dedicated schema. Production gets its own schema and, ideally, its own warehouse account, so development never changes the models dashboards read.
Try it¶
In your fork, add a step that checks source freshness after the build, and open a pull request to see it run.
Hint
Copy the shape of the existing dbt deps + build step: a name, working-directory: oms_dbt_proj, and a run line. Put it last.
Answer
Add this step to the end of .github/workflows/dbt.yml:
- name: Source freshness
working-directory: oms_dbt_proj
run: dbt source freshness --profiles-dir .
The Action's run on your pull request shows a passing Source freshness step. Run dbt source freshness --profiles-dir . locally to see the same result.