Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,10 @@ jobs:
uses: ./.github/workflows/test-build.yml
secrets: inherit

# Deploy Trigger.dev FIRST (right after test-build, before images)
trigger-deploy:
name: Deploy Trigger.dev
needs: test-build
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
uses: ./.github/workflows/trigger-deploy.yml
secrets: inherit
permissions:
id-token: write
contents: read

# Build AMD64 images and push to ECR immediately (+ GHCR for main)
build-amd64:
name: Build AMD64
needs: trigger-deploy
needs: test-build
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
runs-on: blacksmith-4vcpu-ubuntu-2404
permissions:
Expand Down Expand Up @@ -122,7 +111,7 @@ jobs:
# Build ARM64 images for GHCR (main branch only, runs in parallel)
build-ghcr-arm64:
name: Build ARM64 (GHCR Only)
needs: trigger-deploy
needs: test-build
runs-on: linux-arm64-8-core
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
Expand Down Expand Up @@ -209,7 +198,15 @@ jobs:
"${IMAGE_BASE}:${{ github.sha }}-arm64"
docker manifest push "${IMAGE_BASE}:${{ github.sha }}"

# Process docs embeddings (only needs ECR images from build-amd64)
# Deploy Trigger.dev (after ECR images are pushed, runs in parallel with process-docs)
trigger-deploy:
name: Deploy Trigger.dev
needs: build-amd64
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
uses: ./.github/workflows/trigger-deploy.yml
secrets: inherit

# Process docs embeddings (after ECR images are pushed, runs in parallel with trigger-deploy)
process-docs:
name: Process Docs
needs: build-amd64
Expand Down
39 changes: 2 additions & 37 deletions .github/workflows/trigger-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
cancel-in-progress: false
env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
permissions:
id-token: write
contents: read

steps:
- name: Checkout code
Expand All @@ -34,44 +31,12 @@ jobs:
- name: Install dependencies
run: bun install

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
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'
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

- 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.deploymentVersion }}" \
--type "String" \
--overwrite
run: npx --yes trigger.dev@4.0.4 deploy -e staging

- name: Deploy to Trigger.dev (Production)
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

- 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.deploymentVersion }}" \
--type "String" \
--overwrite
run: npx --yes trigger.dev@4.0.4 deploy