Report this

What is the reason for this report?

Update App Platform to user Github action and Docker

Posted on December 21, 2022

My original code was in Django. I have since created a full stack application with Django Rest Framework and Angular. I also wrap both end in a Docker container.

I am now getting errors in the build ‘could not detect app files that match known buildpacks’.

My old buildpack are: Custom Build Command, Profile, and Python. How can I remove some of these buildpacks?

I know why I am getting this error. My code formate is: -.github -workflows -deployment.yml

  • backend
    • backend applications
    • Dockerfile
    • manage.py
    • requirement.txt
  • frontend
    • angular frontend code
    • nginx
    • Dockerfile
  • .dockerignor
  • docker-compose.yml

My deployment.yml:

name: Upload to Digital Ocean

on:
  pull_request:
    branches:
      - prod
  push:
    branches:
      - prod

jobs:
  build-and-deploy-back:
    name: Build and Deploy Backend
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USER }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v3
        with:
          context: ./backend
          push: true
          tags: ${{ secrets.DOCKERHUB_USER }}/uop-backend:latest

  build-and-deploy-frontend:
    name: Build and Deploy Frontend
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USER }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v3
        with:
          context: ./frontend
          push: true
          tags: ${{ secrets.DOCKERHUB_USER }}/uop-frontend:latest

  deploy-to-digitalocean:
    runs-on: ubuntu-latest
    name: Deploy To Digital Ocean
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      - name: Deploy
        uses: digitalocean/app_action@main
        with:
          app_name: sea-lion-app
          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
          images:
            '[{
              "name": "",
              "image": {
                "registry_type": "DOCR"
                "repository": "uop-backend"
                "tag":"latest"
              },
            },
            {
            "name":"",
            "image":{
            "registry_type": "DOCR"
                "repository": "uop-frontend"
                "tag":"latest"
            }
            }]'

To get the last job, I follow https://github.com/digitalocean/sample-golang-github-action, and the first two jobs was from a YouTube. The last job is giving me the error, as well as the build error from the build packs.

What am I missing? I cannot destroy the app because then my database will be destroy.



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.

Hi there,

Looks like your app is still using buildpacks, but you’re now deploying Docker images. You need to update the App Platform config to use Docker images instead of buildpacks.

Go to your app in the DigitalOcean dashboard, edit each service, switch the source to “Deploy from registry,” and point it to your DockerHub image and tag. That should fix the build error without needing to destroy the app or lose your database.

https://docs.digitalocean.com/products/app-platform/how-to/deploy-from-container-images/

- Bobby

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.