Deploy Code Changes On Merge
Last updated
Was this helpful?
Last updated
Was this helpful?
This template creates a Bolt schedule that automatically executes dbt™ model builds and deploys them to production when a new pull request is merged into the main branch. This type of Bolt schedule is commonly referred to as or "CD".
Automatically deploy dbt™ model changes to production after merge
Rebuild only modified models and their downstream dependencies
is connected to your data warehouse provider
Existing Bolt Schedule that has executed "dbt run" successfully
Implementing the Continuous Deployment schedule requires a multi-step setup process. Follow these instructions carefully to ensure a successful configuration:
This initial setup lays the foundation for the Continuous Deployment schedule. It involves creating the schedule, configuring the Deferred Schedule and Last Run Type settings, and defining the commands and triggers.
From the Bolt home screen, select + New Schedule and then + Create New Schedule.
Schedule Type: Select Deferred, which enables manifest comparison between runs to identify the minimal set of models that need to be rebuilt.
Name: Provide a relevant name (e.g. "Continuous Deployment")
Description (Optional): Describe the purpose of this schedule (e.g. "Deploy dbt models to production when a new pull request is merged")
Deferred Schedule: Initially, select an existing production schedule that has successfully executed the dbt run
command. This allows the first Continuous Deployment run to have manifest files (AKA ) to compare against.
Last Run Type: Select Last Successful Run to ensure the schedule defers to a run that completed without any errors.
Command Settings: Add dbt run --select state:modified+
to rebuild only the dbt models that have been modified since the last successful run.
Trigger Type:
If on GitHub, use the "On Merge" trigger to automatically run the schedule when a pull request is merged.
Click "Deploy" to publish the new Continuous Deployment schedule.
The first run of the Continuous Deployment schedule is crucial, as it generates the initial manifest files (artifacts) that will be used for state comparison in subsequent runs. This part covers executing that initial run.
From the Bolt home screen, click on the newly created Continuous Deployment schedule.
Click "Run" to execute an initial run of the schedule and generate the manifest files (artifacts).
After the initial run, we can update the Deferred Schedule configuration to make the Continuous Deployment schedule self-sustaining. This allows it to compare each subsequent run against its own previous successful execution.
From the Bolt home screen, click on the Continuous Deployment schedule.
Click "Edit" to modify the schedule configuration.
Update the Deferred Schedule to "self" so the schedule can compare against its own previous successful run.
Click "Deploy" to save the changes.
Now your Continuous Deployment schedule is set up and ready to automatically deploy dbt™ model changes to production after each merge. The schedule will intelligently rebuild only the necessary models, optimizing compute and providing immediate visibility into the deployment status.
If you've implemented, don't include dbt build
as Turbo CI already handles model building and tests in the pull request workflow.
If on other platforms (, , ), use the "Standard Schedule" trigger set to "OFF" and trigger manually.
(Optional): Configure success, failure, and SLA breach alerts via email, Slack, or MS Teams.
Verify the initial run was successful by checking the
To view all generated , see documentation .