If you’ve connected Lightdash to GitHub, you can setup a github action
and get Lightdash to compile your project and test your changes whenever you open a pull request.
Settings
, on the left sidebar, click on Secrets
under Security
. Now click on the New repository secret
LIGHTDASH_API_KEY
Settings
> Personal Access Tokens
. This is the token you’ll put in for LIGHTDASH_API_KEY
.
LIGHTDASH_PROJECT
https://eu1.lightdash.cloud/projects/3538ab33-dc90-aabb-bc00-e50bba3a5f69/tables
, then 3538ab33-dc90-45f0-aabb-e50bba3a5f69
is your LIGHTDASH_PROJECT
LIGHTDASH_URL
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
profiles.yml
file. You can see what’s in there by typing cat ~/.dbt/profiles.yml
in your terminal.prod
and dev
profile, you probably want to use the information from your prod
profile for your GitHub action.DBT_PROFILES
secret.
BigQuery
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
Redshift
Snowflake
DataBricks
Actions
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
.
lightdash
, you would change this line to: run: lightdash compile --select tag:lightdash --project-dir "$PROJECT_DIR" --profiles-dir . --profile prod || lightdash compile --select tag:lightdash --project-dir "$PROJECT_DIR" --profiles-dir .
compile-lightdash.yml
And commit this to your repo by clicking on Start commit
.
lightdash compile
will run and check to see if any of the changes you made will break your Lightdash instance.
You can see the log on the Github actions
page