> 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

[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 creates a target per PR                                | You create the target once in Viewport                                                            |
| Which URL does Duku explore?   | The resolved PR preview URL, or `exploration-url` if you pass one | The target's configured build URL, or `url` if you override it                                    |
| 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](/integrations/github-actions/configuration-reference.md) when you need to override URL resolution or tune test run settings.
