From 312b890fe806315ad52248494984f6db0923a0cf Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Tue, 30 Sep 2025 16:30:14 -0700 Subject: [PATCH 1/3] Capture correct deployment version output --- .github/workflows/trigger-deploy.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/trigger-deploy.yml b/.github/workflows/trigger-deploy.yml index f15aa8af82..94f644679a 100644 --- a/.github/workflows/trigger-deploy.yml +++ b/.github/workflows/trigger-deploy.yml @@ -45,18 +45,14 @@ jobs: id: deploy-staging working-directory: ./apps/sim run: | - OUTPUT=$(npx --yes trigger.dev@4.0.4 deploy -e staging --skip-promotion 2>&1) - echo "$OUTPUT" - VERSION=$(echo "$OUTPUT" | grep -oP 'Successfully deployed version \K[0-9]+\.[0-9]+' || echo "$OUTPUT" | grep -oP 'version \K[0-9]+\.[0-9]+' | head -1) - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Deployed version: $VERSION" + npx --yes trigger.dev@4.0.4 deploy -e staging --skip-promotion - name: Store Staging version in Parameter Store if: github.ref == 'refs/heads/staging' run: | aws ssm put-parameter \ --name "${{ secrets.TRIGGER_VERSION_SECRET_MANAGER_STAGING }}" \ - --value "${{ steps.deploy-staging.outputs.version }}" \ + --value "${{ steps.deploy-staging.outputs.deploymentVersion }}" \ --type "String" \ --overwrite @@ -65,17 +61,13 @@ jobs: id: deploy-production working-directory: ./apps/sim run: | - OUTPUT=$(npx --yes trigger.dev@4.0.4 deploy --skip-promotion 2>&1) - echo "$OUTPUT" - VERSION=$(echo "$OUTPUT" | grep -oP 'Successfully deployed version \K[0-9]+\.[0-9]+' || echo "$OUTPUT" | grep -oP 'version \K[0-9]+\.[0-9]+' | head -1) - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Deployed version: $VERSION" + npx --yes trigger.dev@4.0.4 deploy --skip-promotion - name: Store Production version in Parameter Store if: github.ref == 'refs/heads/main' run: | aws ssm put-parameter \ --name "${{ secrets.TRIGGER_VERSION_SECRET_MANAGER_PROD }}" \ - --value "${{ steps.deploy-production.outputs.version }}" \ + --value "${{ steps.deploy-production.outputs.deploymentVersion }}" \ --type "String" \ --overwrite \ No newline at end of file From 40dddd78924b2cfb01651d4480d6e5618b47f5dd Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Tue, 30 Sep 2025 16:34:13 -0700 Subject: [PATCH 2/3] Add trigger access token to each step --- .github/workflows/trigger-deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/trigger-deploy.yml b/.github/workflows/trigger-deploy.yml index 94f644679a..2385cb40b2 100644 --- a/.github/workflows/trigger-deploy.yml +++ b/.github/workflows/trigger-deploy.yml @@ -44,6 +44,8 @@ jobs: if: github.ref == 'refs/heads/staging' id: deploy-staging working-directory: ./apps/sim + env: + TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }} run: | npx --yes trigger.dev@4.0.4 deploy -e staging --skip-promotion @@ -60,6 +62,8 @@ jobs: if: github.ref == 'refs/heads/main' id: deploy-production working-directory: ./apps/sim + env: + TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }} run: | npx --yes trigger.dev@4.0.4 deploy --skip-promotion From bc15e99384390ab51204f021d1847f0d0654a1f3 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Tue, 30 Sep 2025 16:36:08 -0700 Subject: [PATCH 3/3] Use correct arn --- .github/workflows/trigger-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger-deploy.yml b/.github/workflows/trigger-deploy.yml index 2385cb40b2..93a145019d 100644 --- a/.github/workflows/trigger-deploy.yml +++ b/.github/workflows/trigger-deploy.yml @@ -37,8 +37,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 + role-to-assume: ${{ github.ref == 'refs/heads/main' && secrets.AWS_ROLE_TO_ASSUME || secrets.STAGING_AWS_ROLE_TO_ASSUME }} + aws-region: ${{ github.ref == 'refs/heads/main' && secrets.AWS_REGION || secrets.STAGING_AWS_REGION }} - name: Deploy to Trigger.dev (Staging) if: github.ref == 'refs/heads/staging'