trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

Can't deploy using Github Actions on Turborepo

Open joelbqz opened this issue 1 year ago • 1 comments

Describe the bug

Can't deploy with Github Actions

image

Reproduction repo

_

To reproduce

use the Github Action provided by the docs

Additional information

It's a turbo repo

joelbqz avatar Sep 05 '24 01:09 joelbqz

Hi there! I understand you're having trouble deploying using Github Actions with trigger.dev in your Turborepo setup. Let me help you resolve this issue.

Looking at the error and the latest documentation, there are a few things we need to address:

  1. First, make sure you're following the latest deployment guidelines for Github Actions. You'll need a proper workflow file that looks something like this:
name: Deploy Trigger.dev
on:
  push:
    branches: [main]
    paths:
      - 'trigger/**'

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Deploy Trigger.dev
        env:
          TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
        run: npx trigger.dev@latest deploy
  1. Since you're running into an issue with esbuild-decorators, you should:

    • Add esbuild-decorators to your dependencies if not already present
    • Configure it properly in your build setup
  2. For better version management, I recommend adding the deploy command to your package.json:

{
  "scripts": {
    "deploy:trigger": "npx trigger.dev@latest deploy",
    "deploy:trigger:staging": "npx trigger.dev@latest deploy --env staging"
  }
}

This way, your Github Actions workflow will use the version specified in your package.json.

The error you're seeing with esbuild-decorators suggests there might be a compatibility issue with the beta version you're using. I recommend:

  1. Upgrading to the latest stable version of trigger.dev
  2. Ensuring all your dependencies are properly installed before deployment
  3. Adding a build step before deployment if needed

If you continue to experience issues, please share your complete:

  • trigger.config.ts file
  • Github Actions workflow file
  • package.json dependencies

This will help us provide more specific guidance for your setup.

References:

Let me know if you need any clarification or run into other issues!

Cirr0e avatar Nov 25 '24 05:11 Cirr0e