lightdash deploy
syncs the changes in your dbt project to Lightdash
If you’ve made some changes to your dbt project and you’d like to make them available in your Lightdash project, you can easily do this using the lightdash deploy
command in the Lightdash CLI tool.
Lightdash’s deploy command will deploy using your default dbt profile unless you specify to use a different target.For example, if you’ve set up a developer profile where it targets a dev dataset (like
dbt_khindson.my_model_names
), then you’ll need to pass the production target in your lightdash deploy
command. Something like: lightdash deploy --profile prod
.Automatically deploy your changes to Lightdash using a GitHub action
If you’ve connected Lightdash to GitHub, you can setup agithub action
and get Lightdash to deploy your project automatically. This is the easiest way to keep Lightdash in sync with your changes in dbt.
Step 1: add the credentials to Github secrets
We are going to add some secrets and config to GitHub actions, but you don’t want those to be public, so the best way to do this is to add them as secrets on Github.If you already have a GitHub action for Lightdash, then you can use the same Lightdash secrets you created for your other action.
Settings
, on the left sidebar, click on Secrets
under Security
. Now click on the New repository secret

LIGHTDASH_API_KEY
Create a new personal access token, by going to Settings
> Personal Access Tokens
. This is the token you’ll put in for LIGHTDASH_API_KEY
.

LIGHTDASH_PROJECT
The UUID for your project. For example, if your URL looks like https://eu1.lightdash.cloud/projects/3538ab33-dc90-aabb-bc00-e50bba3a5f69/tables
, then 3538ab33-dc90-45f0-aabb-e50bba3a5f69
is your LIGHTDASH_PROJECT
LIGHTDASH_URL
This is either https://eu1.lightdash.cloud
or https://app.lightdash.cloud
for Lightdash Cloud users (check the URL to your Lightdash project). If you self-host, this should be your own custom domain.
DBT_PROFILES
Some tips for this bit:
- You might be able to copy a bunch of the information from your local
profiles.yml
file. You can see what’s in there by typingcat ~/.dbt/profiles.yml
in your terminal. - If you have a separate
prod
anddev
profile, you probably want to use the information from yourprod
profile for your GitHub action. - If you want to have different connection settings depending on the user that opened the pull request (dev profiles), then check out this guide.
DBT_PROFILES
secret.
BigQuery
BigQuery
BigQuery OAuth:Step 1: create a secret called Step 2: create another secret called More info in dbt’s profiles docs: https://docs.getdbt.com/reference/warehouse-profiles/bigquery-profile#service-account-file
GOOGLE_APPLICATION_CREDENTIALS
Add the service account credentials (the JSON file) that you want to use for your GitHub action. It should look something like this:DBT_PROFILES
Copy-paste this template into the secret and fill out the details.This will always use this project connection in your GitHub actions. If you want your preview projects to have different connection settings depending on the user that opened the pull request (dev profiles), then see what you need to add to your secret in this guide.Postgres
Postgres
Postgres profile configuration:More info in dbt’s profiles docs: https://docs.getdbt.com/reference/warehouse-profiles/postgres-profile#profile-configurationThis will always use this project connection in your GitHub actions. If you want your preview projects to have different connection settings depending on the user that opened the pull request (dev profiles), then see what you need to add to your secret in this guide.
Redshift
Redshift
Redshift password-based authentication:More info in dbt’s profiles docs: https://docs.getdbt.com/reference/warehouse-profiles/redshift-profile#password-based-authenticationThis will always use this project connection in your GitHub actions. If you want your preview projects to have different connection settings depending on the user that opened the pull request (dev profiles), then see what you need to add to your secret in this guide.
Snowflake
Snowflake
User / Password authentication:More info in dbt’s profiles docs: https://docs.getdbt.com/reference/warehouse-profiles/snowflake-profile#user—password-authenticationThis will always use this project connection in your GitHub actions. If you want your preview projects to have different connection settings depending on the user that opened the pull request (dev profiles), then see what you need to add to your secret in this guide.
DataBricks
DataBricks
Set up a DataBricks target:More info in dbt’s profiles docs: https://docs.getdbt.com/reference/warehouse-profiles/bigquery-profile#service-account-jsonThis will always use this project connection in your GitHub actions. If you want your preview projects to have different connection settings depending on the user that opened the pull request (dev profiles), then see what you need to add to your secret in this guide.
Step 2: Create deploy.yml workflow in Github
Go to your repo, click onActions
menu.
If you don’t have any GitHub actions, you’ll just need to click on Configure

New workflow
, then select setup a workflow yourself
.

deploy-lightdash.yml
And commit this to your repo by clicking on Start commit
.
You’re done!
Everytime you make a change to your repo, on themain
branch, it will automatically deploy your new config into your Lightdash projects
You can see the log on the Github actions
page
