lightdash deploypushes your dbt project to Lightdash
Before you deploy: A quick word of caution
Running
lightdash deploy uses your local dbt profile (from your profiles.yml). If your local profile isn’t pointing to production, you could deploy to the wrong environment.
This works in simple setups, but can introduce risk when using multiple environments or working in a team.- Spin up Lightdash preview environments for each PR
- Deploy production changes consistently using shared, secure credentials
- Avoid accidentally pointing to the wrong target in your local profile
Option 1: Deploy via the CLI
Basic usage:- Use your local dbt profile for the connection
- Push the current state of your local dbt project files (including uncommitted changes or code from your active branch) to the authenticated Lightdash project
- Trigger a re-compile and refresh of your Lightdash project
Be careful — if your local prod profile isn’t properly pointing to your production database,
this can result in incorrect connections (e.g. accidentally deploying to a dev dataset).
Option 2: Safely refresh metadata using lightdash refresh
If you only need to refresh your Lightdash project to reflect upstream dbt changes (like updated models or docs), but don’t want to deploy your local dbt setup, you can use:
- Uses the saved dbt credentials from Lightdash, not your local profile
- Simply re-runs the metadata sync and model parsing
- Makes it safe to trigger from anywhere without risk of pointing to the wrong target
lightdash refresh.
