fly github action not working, but locally is fine

I have this github action

name: Fly Deploy Staging

on:
  push:
    branches:
      - staging

jobs:
  deploy:
    name: Deploy app
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: flyctl deploy --remote-only --config fly.staging.toml
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
          DB_NAME: ${{ secrets.DB_NAME }}
          DB_USER: ${{ secrets.DB_USER }}
          DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
          DB_HOST: ${{ secrets.DB_HOST }}
          DB_PORT: ${{ secrets.DB_PORT }}
          SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
          SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}

but it crashes:

Error:

Could not find App “xxxxxxxx”
Error: Process completed with exit code 1.

Hi @nicolasvegam

This could be a token issue. If you have more than one app (like production and staging) and are using deploy tokens, then you’ll need to create separate tokens for each app (for FLY_API_TOKEN).

Check out:

and

1 Like

I am actually doing that

usign flyctl tokens create deploy -x 999999h --config fly.staging.toml

and also I tried generating token from the UI of fly

Could you confirm that the app name for which you created the token is the same as the value for app in fly.staging.toml?

Yes!

app = "carvuk-api-nest-stg"
primary_region = "scl"

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.