The error "cannot deploy images for non-image backed service" means your Render service is currently configured as a source code service (connected to a Git repository) rather than an image-based service.
To fix this, you need to change your Render service to be image-backed. Here's how:
Option 1: Convert Existing Service to Image-Based
- Go to your Render Dashboard
- Navigate to your service
- Go to Settings tab
- Look for "Source" or "Build & Deploy" section
- Change the source type from "Git Repository" to "Image"
- Set the Image URL to your GHCR image (e.g.,
ghcr.io/your-username/your-repo:latest)
- Save the changes
Option 2: Create a New Image-Based Service
If you can't convert the existing service, create a new one:
- In Render Dashboard, click "New +"
- Select "Web Service"
- Choose "Deploy an existing image"
- Enter your image URL:
ghcr.io/your-username/your-repo:latest
- Configure your service settings (name, region, instance type, etc.)
- Update your GitHub secrets with the new
RENDER_SERVICE_ID
Option 3: Use the Render API to Update Service Type
You can also programmatically convert your service using the Render API. Add this step before the deploy step in your workflow:
- name: 🔧 Convert service to image-based (if needed)
env:
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
RENDER_SERVICE_ID: ${{ secrets.RENDER_SERVICE_ID }}
IMAGE_URL: ${{ steps.meta.outputs.tags }}
run: |
echo "Converting service to image-based..."
curl -s -X PATCH \
"https://api.render.com/v1/services/$RENDER_SERVICE_ID" \
-H "Authorization: Bearer $RENDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"serviceDetails": {
"type": "web_service",
"image": {
"imageUrl": "'"$IMAGE_URL"'"
}
}
}'
echo "Waiting for service update to complete..."
sleep 10
Important Notes:
- Image Registry Access: Make sure your GHCR repository is either public or that Render has access to it
- Environment Variables: If your current service has environment variables, you'll need to copy them to the new image-based service
- Custom Domains: Any custom domains will need to be reconfigured if you create a new service
The easiest approach is usually Option 1 - just change the existing service to be image-based through the Render Dashboard.