@@ -41,14 +41,18 @@ For full details see our [pricing page](https://trigger.dev/pricing).
41
41
42
42
## Using preview branches using GitHub Actions (recommended)
43
43
44
- This GitHub Action
44
+ This GitHub Action will:
45
+
46
+ 1 . Automatically create a preview branch for your Pull Request (if the branch doesn't already exist).
47
+ 2 . Deploy the preview branch.
48
+ 3 . Archive the preview branch when the Pull Request is merged/closed.
45
49
46
50
``` yml .github/workflows/trigger-preview-branches.yml
47
51
name : Deploy to Trigger.dev (preview branches)
48
52
49
53
on :
50
54
pull_request :
51
- types : [opened, synchronize, reopened, closed, merged ]
55
+ types : [opened, synchronize, reopened, closed]
52
56
53
57
jobs :
54
58
deploy-preview :
@@ -70,12 +74,14 @@ jobs:
70
74
TRIGGER_ACCESS_TOKEN : ${{ secrets.TRIGGER_ACCESS_TOKEN }}
71
75
` ` `
72
76
73
- For this workflow to work, you need to set up the following secrets in your GitHub repository:
77
+ For this workflow to work, you need to set the following secrets in your GitHub repository:
74
78
75
- - ` TRIGGER_ACCESS_TOKEN`: Your Trigger.dev personal access token. View the instructions [here](/github-actions) to learn more .
79
+ - ` TRIGGER_ACCESS_TOKEN`: Your Trigger.dev personal access token. View the instructions [here](/github-actions) to learn how .
76
80
77
81
Notice that the deploy command has `--env preview` at the end. We automatically detect the preview branch from the GitHub actions env var.
78
82
83
+ You can manually specify the branch using `--branch <branch-name>` in the deploy command, but this isn't required.
84
+
79
85
# # Manually creating, deploying and archiving preview branches
80
86
81
87
# ## Creating and archiving preview branches from the dashboard
0 commit comments