Skip to content

Commit da707fa

Browse files
improvement(gh-action): add gh action to deploy to correct environment for trigger.dev (#1060)
* improvement(gh-action): add gh action to deploy to correct environment for trigger.dev * add dep installation * change away from pull request target
1 parent 9ffaf30 commit da707fa

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Trigger.dev Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
9+
jobs:
10+
deploy:
11+
name: Trigger.dev Deploy
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: trigger-deploy-${{ github.ref }}
15+
cancel-in-progress: false
16+
env:
17+
TRIGGER_API_KEY: ${{ github.ref == 'refs/heads/main' && secrets.TRIGGER_API_KEY || secrets.STAGING_TRIGGER_API_KEY }}
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 'lts/*'
26+
27+
- name: Setup Bun
28+
uses: oven-sh/setup-bun@v2
29+
with:
30+
bun-version: latest
31+
32+
- name: Install dependencies
33+
run: bun install
34+
35+
- name: Deploy to Staging
36+
if: github.ref == 'refs/heads/staging'
37+
working-directory: ./apps/sim
38+
run: npx --yes trigger.dev@latest deploy -e staging
39+
40+
- name: Deploy to Production
41+
if: github.ref == 'refs/heads/main'
42+
working-directory: ./apps/sim
43+
run: npx --yes trigger.dev@latest deploy
44+

0 commit comments

Comments
 (0)