Report this

What is the reason for this report?

Unable to deploy DOCR with app_action with giithub actions

Posted on January 28, 2022

Hi,

I have issue deploying DOCR on app platform with github actions.

I successfully public image to DOCR and then in next step when I try to deploy that image to ma app platform I got this error:

 "[{ \"name\": \"web\", \"repository\": \"registry.digitalocean.com/gamio/gamio-api\", \"tag\": \"52b4fb8\" } ]" "gamio-api" "***"
all components with following names were not found in your deployed app spec

I followed guiedlines on app action

here is mine github action workflow part that comunicates with digital ocean:

      - name: Generate GITHUB_SHA
        id: github-sha
        shell: bash
        run: |
          SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
          echo "::set-output name=sha::$SHORT_SHA"

      - name: Build container image
        run: docker build . -t registry.digitalocean.com/gamio/gamio-api:${{steps.github-sha.outputs.sha}}

      - name: Install doctl
        uses: digitalocean/action-doctl@v2
        with:
          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

      - name: Log in to DigitalOcean Container Registry with short-lived credentials
        run: doctl registry login --expiry-seconds 600

      - name: Publish Image to Digital Ocean Container Registry
        run: docker push registry.digitalocean.com/gamio/gamio-api:${{steps.github-sha.outputs.sha}}

      - name: DigitalOcean App Platform deployment
        uses: digitalocean/app_action@main
        with:
          app_name: gamio-api
          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
          images: '[{
            "name": "web",
            "repository": "registry.digitalocean.com/gamio/gamio-api",
            "tag": "${{steps.github-sha.outputs.sha}}"
            }
            ]'

my app on digital ocean have name gamio-api and also a web component that should be deployed with this action is named gamio-api



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey!

The error message “all components with following names were not found in your deployed app spec” indicates that the app_action couldn’t find a matching component named “web” in your App Platform’s configuration. This leads to a deployment failure.

Possible Causes:

  1. Component Name Mismatch: There is a discrepancy between the component name used in your GitHub Action workflow (“web”) and the actual component name defined in your DigitalOcean App Platform.
  2. Missing App Spec: The app_action might not be able to locate or read your app specification file (usually named .do/app.yaml).
  3. Incorrect App Spec Structure: The component definitions within your app spec file might have errors or an unexpected format.

Troubleshooting Steps:

  1. Verify Component Names:

    • Double-check the component name in your DigitalOcean App Platform’s dashboard. Make sure it matches exactly with the “name” field used within the images section of your GitHub Action.
  2. App Spec Location and Structure:

    • Location: Ensure your app spec file (app.yaml) is located in the .do directory at the root of your project repository.
    • Structure: Here’s a basic example of an app.yaml with a component named “web”:

    YAML

    name: my-app # You can change this name
    services:
      - name: web # This name must match the value in your GitHub Action
        image: registry.digitalocean.com/my-repo/my-image:latest
        # Other component settings
    
  3. Debug with doctl:

    • Install the doctl CLI.
    • Use doctl apps get <your-app-id> -o yaml to retrieve and examine the current app configuration directly from DigitalOcean.

Additional Tips:

  • Clear Logging: Add more verbose logging to your GitHub Action to see if it provides any additional clues.
  • Example Workflow: Search for example GitHub Actions workflows that successfully use app_action for deployment. Compare your setup against a working example.

If the problem persists, please provide the following for more assistance:

  • App Spec (app.yaml) Contents: Your app configuration file.
  • GitHub Actions Workflow: The complete relevant code.
  • DigitalOcean App Configuration: A screenshot or description of your App Platform components’ setup.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.