Skip to content

Action container missing dependencies for flyctl launch auto-detection #80

@som-matrix

Description

@som-matrix

Problem Statement:

When using this action with Rails applications (or other framework-based apps) without providing a pre-built image parameter, the deployment fails during the app creation phase.

The action's entrypoint.sh script runs flyctl launch at line 57. When no image is provided, this command attempts to auto-detect the application framework by scanning the source code. For Rails applications, this means looking for a Gemfile and attempting to run bundle to confirm the framework.

However, the action runs inside a minimal container that only includes flyctl and basic tools - it doesn't have for eg: in my case Ruby runtimes installed. This causes the framework detection to fail.

Current Flow:

  1. Action receives no image parameter
  2. Attempts flyctl launch --no-deploy --copy-config --name $app --image --region $region --org $org
  3. flyctl scans source code and finds Gemfile
  4. Tries to execute bundle (or npm, pip, etc.) to verify framework
  5. Fails with: exec: "bundle": executable file not found in $PATH

This affects any framework that requires language-specific tools for detection for Rails apps requires bundle.

Potential Solutions:

  1. Add a --skip-scan or similar flag to flyctl launch when the image parameter is empty, to bypass framework detection.
  2. Check for Dockerfile presence - if a Dockerfile exists and no image is provided we can launch the app and it will build the image from the dockerfile path.
  3. Use flyctl apps create only when image is provided, keeping current flyctl launch behavior for simpler apps that don't need framework detection.

Note: I feel we should document the limitation clearly so users know to provide pre-built images for framework apps.

Suggested enhancement for dockerfile path: #79

Current Workaround:

Adding extra 3 steps

  1. create the app first
  2. Build and push the docker image to fly registry
  3. Use that image
- name: Setup flyctl
   uses: superfly/flyctl-actions/setup-flyctl@master
  
- name: Create Fly app if needed
        run: |
         flyctl apps create pr-${{ github.event.number }}-some-name --org example-org || echo "App already exists"
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

 - name: Login to Fly Registry
        uses: docker/login-action@v3
        with:
          registry: registry.fly.io
          username: x
          password: ${{ secrets.FLY_API_TOKEN }}
      
  - name: Build and push rails image to Fly Registry
        run: |
          docker build -t registry.fly.io/pr-${{ github.event.number }}-some-name:latest -f Dockerfile .
          docker push registry.fly.io/pr-${{ github.event.number }}-some-name:latest

      - name: Deploy PR app to Fly.io
        id: deploy
        uses: superfly/fly-pr-review-apps@1.2.1
        with:
          image: registry.fly.io/pr-${{ github.event.number }}-some-name
          cpu: 1
          cpukind: shared
          secrets: EXAMPLE_SECRET=${{secrets.EXAMPLE_SECRET}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions