Skip to content

Commit ef125cd

Browse files
committed
fix(deploy): lowercase image name, add GHCR auth for Azure, fix log tail
- IMAGE_NAME: hardcode scarage1/api-watch (Docker requires lowercase) - Add --container-registry-user/password so Azure can pull from private GHCR - Replace broken --timeout flag with timeout command wrapper - Use non-deprecated --container-image-name flag
1 parent bb48d04 commit ef125cd

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/docker-deploy.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
env:
2424
REGISTRY: ghcr.io
25-
IMAGE_NAME: ${{ github.repository }}
25+
IMAGE_NAME: scarage1/api-watch
2626
AZURE_WEBAPP_NAME: apiwatch-shivamkumar
2727
AZURE_RESOURCE_GROUP: apiwatch-rg
2828

@@ -125,12 +125,14 @@ jobs:
125125

126126
- name: Configure Azure App Service for Container
127127
run: |
128-
# Set container image
128+
# Set container image with GHCR credentials (private registry)
129129
az webapp config container set \
130130
--name ${{ env.AZURE_WEBAPP_NAME }} \
131131
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
132-
--docker-custom-image-name ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
133-
--docker-registry-server-url https://${{ env.REGISTRY }}
132+
--container-image-name ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
133+
--container-registry-url https://${{ env.REGISTRY }} \
134+
--container-registry-user ${{ github.actor }} \
135+
--container-registry-password ${{ secrets.GITHUB_TOKEN }}
134136
135137
# Set application settings
136138
az webapp config appsettings set \
@@ -170,10 +172,10 @@ jobs:
170172
171173
echo "❌ Health check failed after 6 attempts"
172174
# Dump container logs for debugging
173-
az webapp log tail \
175+
timeout 15 az webapp log tail \
174176
--name ${{ env.AZURE_WEBAPP_NAME }} \
175177
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
176-
--timeout 10 2>&1 | tail -50 || true
178+
2>&1 | tail -50 || true
177179
exit 1
178180
179181
- name: Azure Logout

0 commit comments

Comments
 (0)