Skip to content

Commit 9af06d0

Browse files
committed
More wip on docs
1 parent f03d7ae commit 9af06d0

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

docs/deployment/preview-branches.mdx

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Preview branches"
3-
description: "Create isolated environments for each branch of your code, allowing you to test changes in a dedicated preview environment before merging to production"
3+
description: "Create isolated environments for each branch of your code, allowing you to test changes before merging to production. You can create preview branches manually or automatically with your git branches."
44
---
55

66
import UpgradeToV4Note from "/snippets/upgrade-to-v4-note.mdx";
@@ -9,23 +9,41 @@ import UpgradeToV4Note from "/snippets/upgrade-to-v4-note.mdx";
99

1010
## How does it work?
1111

12-
The "Preview" environment is a special environment where you can create "branches". Normally you would automatically create a preview branch that matches your git branch when a Pull Request is opened (and then archive it automatically when the PR is merged/closed).
12+
The "Preview" environment is a special environment that you can create "branches" from. We recommend you automatically create a preview branch for each git branch when a Pull Request is opened and then archive it automatically when the PR is merged/closed.
1313

1414
The process to use preview branches looks like this:
1515

1616
1. Create a preview branch
1717
2. Deploy to the preview branch (1+ times)
18-
3. Trigger runs using the Preview API key and the branch name
19-
4. Archive the preview branch
18+
3. Trigger runs using your Preview API key (`TRIGGER_SECRET_KEY`) and the branch name (`TRIGGER_PREVIEW_BRANCH`).
19+
4. Archive the preview branch when the branch is done.
2020

2121
There are two main ways to do this:
2222

23-
1. Automatically: using GitHub Actions (recommended)
24-
2. Manually: in the dashboard and/or using the CLI
23+
1. Automatically: using GitHub Actions (recommended).
24+
2. Manually: in the dashboard and/or using the CLI.
2525

26-
## Using preview branches using GitHub Actions
26+
### Limits on active preview branches
2727

28-
```yml
28+
We restrict the number of active preview branches (per project). You can archive a preview branch at any time (automatically or manually) to unlock another slot.
29+
30+
Once archived you can still view the dashboard for the branch but you can't trigger or execute runs (or other write operations).
31+
32+
This limit exists because each branch has an independent concurrency limit. For the Cloud product these are the limits:
33+
34+
| Plan | Active preview branches |
35+
| ----- | ----------------------- |
36+
| Free | 0 |
37+
| Hobby | 5 |
38+
| Pro | 20 (then paid for more) |
39+
40+
For full details see our [pricing page](https://trigger.dev/pricing).
41+
42+
## Using preview branches using GitHub Actions (recommended)
43+
44+
This GitHub Action
45+
46+
```yml .github/workflows/trigger-preview-branches.yml
2947
name: Deploy to Trigger.dev (preview branches)
3048

3149
on:

0 commit comments

Comments
 (0)