1313 cancel-in-progress : false
1414 env :
1515 TRIGGER_ACCESS_TOKEN : ${{ secrets.TRIGGER_ACCESS_TOKEN }}
16+ permissions :
17+ id-token : write
18+ contents : read
1619
1720 steps :
1821 - name : Checkout code
@@ -31,12 +34,48 @@ jobs:
3134 - name : Install dependencies
3235 run : bun install
3336
37+ - name : Configure AWS credentials
38+ uses : aws-actions/configure-aws-credentials@v4
39+ with :
40+ role-to-assume : ${{ secrets.AWS_ROLE_ARN }}
41+ aws-region : us-east-1
42+
3443 - name : Deploy to Trigger.dev (Staging)
3544 if : github.ref == 'refs/heads/staging'
45+ id : deploy-staging
3646 working-directory : ./apps/sim
37- run : npx --yes trigger.dev@4.0.4 deploy -e staging
47+ run : |
48+ OUTPUT=$(npx --yes trigger.dev@4.0.4 deploy -e staging --skip-promotion 2>&1)
49+ echo "$OUTPUT"
50+ 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)
51+ echo "version=$VERSION" >> $GITHUB_OUTPUT
52+ echo "Deployed version: $VERSION"
53+
54+ - name : Store Staging version in Parameter Store
55+ if : github.ref == 'refs/heads/staging'
56+ run : |
57+ aws ssm put-parameter \
58+ --name "${{ secrets.TRIGGER_VERSION_SECRET_MANAGER_STAGING }}" \
59+ --value "${{ steps.deploy-staging.outputs.version }}" \
60+ --type "String" \
61+ --overwrite
3862
3963 - name : Deploy to Trigger.dev (Production)
4064 if : github.ref == 'refs/heads/main'
65+ id : deploy-production
4166 working-directory : ./apps/sim
42- run : npx --yes trigger.dev@4.0.4 deploy
67+ run : |
68+ OUTPUT=$(npx --yes trigger.dev@4.0.4 deploy --skip-promotion 2>&1)
69+ echo "$OUTPUT"
70+ 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)
71+ echo "version=$VERSION" >> $GITHUB_OUTPUT
72+ echo "Deployed version: $VERSION"
73+
74+ - name : Store Production version in Parameter Store
75+ if : github.ref == 'refs/heads/main'
76+ run : |
77+ aws ssm put-parameter \
78+ --name "${{ secrets.TRIGGER_VERSION_SECRET_MANAGER_PROD }}" \
79+ --value "${{ steps.deploy-production.outputs.version }}" \
80+ --type "String" \
81+ --overwrite
0 commit comments