diff --git a/guides/cli/how-to-use-lightdash-deploy.mdx b/guides/cli/how-to-use-lightdash-deploy.mdx index 1d827084..f86b4f23 100644 --- a/guides/cli/how-to-use-lightdash-deploy.mdx +++ b/guides/cli/how-to-use-lightdash-deploy.mdx @@ -16,8 +16,11 @@ This guide will walk you through how it works, when to use each option, and what ## 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. +**`lightdash deploy` pushes directly to your production project.** + +Running this command uses your local dbt profile (from your `profiles.yml`). If your default target points to a dev or staging environment, `lightdash deploy` will overwrite your production semantic layer with that configuration, breaking dashboards for all users. + +If you're working locally, **use [`lightdash preview`](/guides/cli/how-to-use-lightdash-preview) instead**. It creates a temporary, isolated project that won't affect production. For a safer, scalable approach to deploying and previewing changes, use CI/CD. This allows you to: @@ -53,7 +56,7 @@ If your dbt project uses different profiles or targets for dev and prod, you can lightdash deploy --profile prod ``` -Be careful — if your local prod profile isn't properly pointing to your production database, +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). diff --git a/references/lightdash-cli.mdx b/references/lightdash-cli.mdx index ebae015e..3c5d3175 100644 --- a/references/lightdash-cli.mdx +++ b/references/lightdash-cli.mdx @@ -370,9 +370,13 @@ lightdash stop-preview "neon unicorn" Compiles and deploys the current project to your [selected Lightdash Cloud project](#lightdash-config-set-project). - **It is not common practice to use this command from the CLI after initial project creation.** + **`lightdash deploy` pushes directly to your production project.** - This command is usually [used in Github Actions](/guides/cli/how-to-use-lightdash-deploy#automatically-deploy-your-changes-to-lightdash-using-a-github-action) or other deploy scripts. + Running this command from a local branch will overwrite your production semantic layer with whatever is compiled locally, including any dev or staging targets from your `profiles.yml`. This can break dashboards for all users. + + **Use [`lightdash preview`](#lightdash-preview) for local development and testing.** Preview creates a temporary, isolated project that won't affect production. + + For production deploys, we recommend using [CI/CD with GitHub Actions](/guides/cli/how-to-use-lightdash-deploy#automatically-deploy-your-changes-to-lightdash-using-a-github-action). All standard [dbt options](#dbt-options) work with `lightdash deploy`.