Skip to content

Commit 55de5fb

Browse files
committed
Delete all other images in ecr
1 parent be76d0a commit 55de5fb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/main.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,21 @@ jobs:
3333
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3434
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3535

36+
- name: Delete All Images in ACR
37+
run: |
38+
# Delete all images in the 'incstats' repository
39+
az acr repository show-tags --name sbuincstatsnorwayeastecr --repository incstats --query "[*]" -o tsv | \
40+
while read -r image; do
41+
echo "Deleting image: incstats:$image"
42+
az acr repository delete --name sbuincstatsnorwayeastecr --image incstats:$image --yes
43+
done
44+
3645
- name: Build and Push to ACR
3746
uses: docker/build-push-action@v2
3847
with:
3948
push: true
4049
tags: ${{ secrets.AZURE_URL }}/incstats:${{ github.sha }}
4150
file: Dockerfile
42-
build-args: |
43-
DATABASE_URL=your_database_url
4451

4552
- name: Redeploy Azure Container App
4653
run: |

0 commit comments

Comments
 (0)