From da707fa491df6062f66813617d83a4576a237b6a Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Wed, 20 Aug 2025 18:10:43 -0700 Subject: [PATCH] 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 --- .github/workflows/trigger-deploy.yml | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/trigger-deploy.yml diff --git a/.github/workflows/trigger-deploy.yml b/.github/workflows/trigger-deploy.yml new file mode 100644 index 0000000000..57eaf86022 --- /dev/null +++ b/.github/workflows/trigger-deploy.yml @@ -0,0 +1,44 @@ +name: Trigger.dev Deploy + +on: + push: + branches: + - main + - staging + +jobs: + deploy: + name: Trigger.dev Deploy + runs-on: ubuntu-latest + concurrency: + group: trigger-deploy-${{ github.ref }} + cancel-in-progress: false + env: + TRIGGER_API_KEY: ${{ github.ref == 'refs/heads/main' && secrets.TRIGGER_API_KEY || secrets.STAGING_TRIGGER_API_KEY }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Deploy to Staging + if: github.ref == 'refs/heads/staging' + working-directory: ./apps/sim + run: npx --yes trigger.dev@latest deploy -e staging + + - name: Deploy to Production + if: github.ref == 'refs/heads/main' + working-directory: ./apps/sim + run: npx --yes trigger.dev@latest deploy +