Skip to content

Commit 3964b69

Browse files
committed
perf: delete ACR image after successful tests
1 parent 60860ea commit 3964b69

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/k8s_test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,28 @@ jobs:
9898
-h ${{ github.head_ref }} \
9999
-r ${{ env.AZURE_CONTAINER_REGISTRY }} \
100100
-t "${{ inputs.test_cmd }}"
101+
102+
az-acr-delete:
103+
name: "ACR: Delete Test Image"
104+
runs-on: ubuntu-latest
105+
needs: [k8-test]
106+
environment: dev
107+
env:
108+
AZURE_CONTAINER_REGISTRY: ${{ vars.AZURE_CONTAINER_REGISTRY }}
109+
ACR_LOGIN_USERNAME: ${{ secrets.ACR_LOGIN_USERNAME }}
110+
ACR_LOGIN_PASSWORD: ${{ secrets.ACR_LOGIN_PASSWORD }}
111+
steps:
112+
- name: Azure Cloud Login
113+
uses: Azure/login@v2
114+
with:
115+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
116+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
117+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
118+
119+
- name: Delete Test Container Image
120+
uses: azure/cli@v2
121+
with:
122+
inlineScript: |
123+
az acr repository delete \
124+
--name ${{ env.AZURE_CONTAINER_REGISTRY }} \
125+
--image ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:test-${{ github.head_ref }}

0 commit comments

Comments
 (0)