> For the complete documentation index, see [llms.txt](https://docs.duku.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duku.ai/integrations/github-actions/choosing-preview-vs-environment.md).

# Choosing preview vs environment

Decide which action fits your deployment model.

[Not sure which integration fits? Start here.](/integrations/choosing-your-integration.md)

Choose `preview` for short lived pull request deploys. Choose `environment` for stable targets you keep around.

### Side by side

| Question                       | `preview`                                                                                                  | `environment`                                                                                            |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| How long does the target live? | Only for the life of a pull request                                                                        | Across many pull requests and deploys                                                                    |
| How is the target managed?     | The action records a build per commit. When Releases are enabled, each PR gets its own preview environment | You declare the environment once in Product settings, and each run records the commit as a release on it |
| Which URL does Duku explore?   | The resolved PR preview URL, or `exploration-url` if you pass one                                          | The URL the environment declares                                                                         |
| Which triggers fit best?       | `pull_request`                                                                                             | `push`, `schedule`, `workflow_dispatch`, and `pull_request` into a protected branch                      |
| Typical examples               | Vercel previews, Netlify previews, branch deploys                                                          | Staging, production canary, customer demo environment, and PR gating against a stable environment        |

### Rule of thumb

If you would delete the target when the pull request closes, use `preview`.

If the target survives across many pull requests, use `environment`.

If you want to gate a PR by exploring a stable environment, `environment` on `pull_request` into a protected branch is a supported mode.

### Good defaults

* Start with [Quickstart: preview action](/integrations/github-actions/quickstart-preview-action.md) for PR based deploy previews.
* Start with [Quickstart: environment action](/integrations/github-actions/quickstart-environment-action.md) for staging and nightly checks.
* Use Configuration reference when you need to override URL resolution.
