# GitHub Native Continuous Deployment

Paradime Bolt offers a powerful GitHub-native Continuous Deployment (CD) feature that automatically deploys changes to your production environment as soon as they're merged into your production branch.

### Key features:

* Triggers every time a pull request is merged into your specified git branch (e.g., `main`)
* Ideal for CI/CD workflows
* Increases the speed of deploying changes to production
* Refreshes or creates tables immediately after code changes are merged

### Prerequisites

Before setting up GitHub Native Continuous Deployment with Bolt, ensure you have:

1. A [production data warehouse](https://docs.paradime.io/app-help/documentation/settings/connections/scheduler-environment) connection in Paradime.
2. [GitHub app](https://docs.paradime.io/app-help/integrations/ci-cd/github#request-the-installation-to-a-github-organization-owner) in Paradime installed and granted necessary access to your repository.
3. Github [User-level OAuth](https://docs.paradime.io/app-help/integrations/ci-cd/github#github-user-level-oauth) configured in Paradime.

### Setting up GitHub Native Continuous Deployment

1. **Create or Edit a Bolt Schedule**: In the Bolt UI, create a new schedule or modify an existing one.
2. **Set Schedule Type to `deferred`**: This allows your job to leverage results from previous runs, improving efficiency.
3. **Name your continuous deployment schedule**: Choose a descriptive name for easy identification.
4. **Choose a Bolt Schedule to defer to**: Select a previous job run to use as a reference, either from the same schedule or a different one.
5. **Set the comparison method**: Determine how the current run compares with previous runs (e.g., `Last Run`, `Last Successful Run`).
6. **Enter dbt Commands**: Specify the dbt tasks to execute as part of the continuous deployment. For example:

```bash
dbt run --select state:modified
```

7. **Specify the Git Branch**: Choose which branch of your dbt project will be used when the continuous deployment is triggered (e.g., `main`).
8. **Set Trigger Type to `On Merge`**: This automatically triggers the schedule when a pull request is merged into the specified Git branch.
9. **Publish Bolt Schedule**: Save and activate your continuous deployment schedule.

{% hint style="info" %}
**Implement using Paradime's Bolt Template -** [**Test Code Changes on Pull Request**](https://docs.paradime.io/app-help/documentation/bolt/creating-schedules/templates/ci-cd-templates/test-code-changes-on-pull-requests)**.**&#x20;
{% endhint %}

#### Tutorial

{% @arcade/embed flowId="nLpuUz4LBEm7pqp5CFQW" url="<https://app.arcade.software/share/nLpuUz4LBEm7pqp5CFQW>" %}

### Best Practices

1. **Selective Runs**: Use `state:modified+` in your dbt™ run command to only execute changed models and their dependencies.
2. **Deferred State**: Configure the schedule to defer to its own last successful run for efficient incremental builds.
3. **Branch Selection**: Typically set up for your main production branch, but can be configured for other branches if needed.

### Viewing Output of CD Schedules

The Bolt UI provides an interface to view additional details about your continuous deployment schedule, including:

* dbt™ Command Artifacts
* .yml code behind Bolt UI Schedules
* See logs of executed models

{% hint style="info" %}
See [Viewing Schedule Output](https://docs.paradime.io/app-help/documentation/bolt/ci-cd/continuous-deployment-with-bolt/broken-reference) for details.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paradime.io/app-help/documentation/bolt/ci-cd/continuous-deployment-with-bolt/continuous-deployment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
