4
4
workflow_call :
5
5
6
6
jobs :
7
- az-acr -delete-test :
8
- name : " Docker: Delete Test Tags "
7
+ dc-registry -delete :
8
+ name : ' Docker Compose : Delete Registry Images '
9
9
runs-on : ubuntu-latest
10
10
environment : dev
11
11
env :
12
- AZURE_CONTAINER_REGISTRY : ${{ vars.AZURE_CONTAINER_REGISTRY }}
13
- ACR_LOGIN_USERNAME : ${{ secrets.ACR_LOGIN_USERNAME }}
14
- ACR_LOGIN_PASSWORD : ${{ secrets.ACR_LOGIN_PASSWORD }}
12
+ ENVIRONMENT_NAME : dev
13
+ DEV_CONTAINER_REGISTRY : ${{ vars.DEV_CONTAINER_REGISTRY }}
14
+ DEV_LOGIN_USERNAME : ${{ secrets.DEV_LOGIN_USERNAME }}
15
+ DEV_LOGIN_PASSWORD : ${{ secrets.DEV_LOGIN_PASSWORD }}
15
16
steps :
16
- - name : Azure Cloud Login
17
- uses : azure/login@v2
18
- with :
19
- client-id : ${{ secrets.AZURE_CLIENT_ID }}
20
- tenant-id : ${{ secrets.AZURE_TENANT_ID }}
21
- subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
17
+ # Checkout the repository to the GitHub Actions runner
18
+ - name : Checkout
19
+ uses : actions/checkout@v4
20
+ with :
21
+ repository : ' code-kern-ai/cicd-deployment-scripts'
22
+
23
+ - name : Configure branch name
24
+ id : branch_name
25
+ run : echo "GH_REF_NAME=$(echo "test-${{ github.event.ref }}" | sed 's|/|-|g')" >> $GITHUB_OUTPUT
26
+
27
+ - name : Perform Registry Image Deletion
28
+ shell : bash
29
+ run : |
30
+ bash ./dc/registry_delete.sh \
31
+ -e ${{ env.ENVIRONMENT_NAME }} \
32
+ -g ${{ github.repository_owner }} \
33
+ -r ${{ env.DEV_CONTAINER_REGISTRY }} \
34
+ -a ${{ github.event.repository.name }} \
35
+ -t "${{ steps.branch_name.outputs.GH_REF_NAME }}" \
36
+ -u "${{ env.DEV_LOGIN_USERNAME }}:${{ env.DEV_LOGIN_PASSWORD }}"
37
+
38
+ # az-acr-delete-test:
39
+ # name: "Docker: Delete Test Tags"
40
+ # runs-on: ubuntu-latest
41
+ # environment: dev
42
+ # env:
43
+ # AZURE_CONTAINER_REGISTRY: ${{ vars.AZURE_CONTAINER_REGISTRY }}
44
+ # ACR_LOGIN_USERNAME: ${{ secrets.ACR_LOGIN_USERNAME }}
45
+ # ACR_LOGIN_PASSWORD: ${{ secrets.ACR_LOGIN_PASSWORD }}
46
+ # steps:
47
+ # - name: Azure Cloud Login
48
+ # uses: azure/login@v2
49
+ # with:
50
+ # client-id: ${{ secrets.AZURE_CLIENT_ID }}
51
+ # tenant-id: ${{ secrets.AZURE_TENANT_ID }}
52
+ # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
22
53
23
- - name : Configure branch name
24
- id : branch_name
25
- run : echo "GH_REF_NAME=$(echo "test-${{ github.event.ref }}" | sed 's|/|-|g')" >> $GITHUB_OUTPUT
54
+ # - name: Configure branch name
55
+ # id: branch_name
56
+ # run: echo "GH_REF_NAME=$(echo "test-${{ github.event.ref }}" | sed 's|/|-|g')" >> $GITHUB_OUTPUT
26
57
27
- - name : Delete Container Image
28
- uses : azure/cli@v2
29
- with :
30
- inlineScript : |
31
- az acr repository delete \
32
- --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
33
- --image ${{ github.event.repository.name }}:${{ steps.branch_name.outputs.GH_REF_NAME }} \
34
- --yes || true
58
+ # - name: Delete Container Image
59
+ # uses: azure/cli@v2
60
+ # with:
61
+ # inlineScript: |
62
+ # az acr repository delete \
63
+ # --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
64
+ # --image ${{ github.event.repository.name }}:${{ steps.branch_name.outputs.GH_REF_NAME }} \
65
+ # --yes || true
35
66
36
- az acr repository delete \
37
- --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
38
- --image ${{ github.event.repository.name }}:${{ steps.branch_name.outputs.GH_REF_NAME }}-cache \
39
- --yes || true
67
+ # az acr repository delete \
68
+ # --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
69
+ # --image ${{ github.event.repository.name }}:${{ steps.branch_name.outputs.GH_REF_NAME }}-cache \
70
+ # --yes || true
40
71
41
- az-acr-delete-matrix :
42
- name : ' Docker: Delete Branch Tags'
43
- runs-on : ubuntu-latest
44
- environment : dev
45
- env :
46
- AZURE_CONTAINER_REGISTRY : ${{ vars.AZURE_CONTAINER_REGISTRY }}
47
- ACR_LOGIN_USERNAME : ${{ secrets.ACR_LOGIN_USERNAME }}
48
- ACR_LOGIN_PASSWORD : ${{ secrets.ACR_LOGIN_PASSWORD }}
49
- strategy :
50
- matrix :
51
- platform : [amd64, arm64]
52
- steps :
53
- - name : Azure Cloud Login
54
- uses : azure/login@v2
55
- with :
56
- client-id : ${{ secrets.AZURE_CLIENT_ID }}
57
- tenant-id : ${{ secrets.AZURE_TENANT_ID }}
58
- subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
72
+ # az-acr-delete-matrix:
73
+ # name: 'Docker: Delete Branch Tags'
74
+ # runs-on: ubuntu-latest
75
+ # environment: dev
76
+ # env:
77
+ # AZURE_CONTAINER_REGISTRY: ${{ vars.AZURE_CONTAINER_REGISTRY }}
78
+ # ACR_LOGIN_USERNAME: ${{ secrets.ACR_LOGIN_USERNAME }}
79
+ # ACR_LOGIN_PASSWORD: ${{ secrets.ACR_LOGIN_PASSWORD }}
80
+ # strategy:
81
+ # matrix:
82
+ # platform: [amd64, arm64]
83
+ # steps:
84
+ # - name: Azure Cloud Login
85
+ # uses: azure/login@v2
86
+ # with:
87
+ # client-id: ${{ secrets.AZURE_CLIENT_ID }}
88
+ # tenant-id: ${{ secrets.AZURE_TENANT_ID }}
89
+ # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
59
90
60
- - name : Configure branch name
61
- id : branch_name
62
- run : echo "GH_REF_NAME=$(echo "${{ github.event.ref }}" | sed 's|/|-|g')" >> $GITHUB_OUTPUT
91
+ # - name: Configure branch name
92
+ # id: branch_name
93
+ # run: echo "GH_REF_NAME=$(echo "${{ github.event.ref }}" | sed 's|/|-|g')" >> $GITHUB_OUTPUT
63
94
64
- - name : Delete Branch Container Image
65
- uses : azure/cli@v2
66
- with :
67
- inlineScript : |
68
- az acr repository delete \
69
- --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
70
- --image ${{ github.event.repository.name }}:${{ matrix.platform}}-${{ steps.branch_name.outputs.GH_REF_NAME }} \
71
- --yes
95
+ # - name: Delete Branch Container Image
96
+ # uses: azure/cli@v2
97
+ # with:
98
+ # inlineScript: |
99
+ # az acr repository delete \
100
+ # --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
101
+ # --image ${{ github.event.repository.name }}:${{ matrix.platform}}-${{ steps.branch_name.outputs.GH_REF_NAME }} \
102
+ # --yes
72
103
73
- az acr repository delete \
74
- --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
75
- --image ${{ github.event.repository.name }}:${{ matrix.platform}}-${{ steps.branch_name.outputs.GH_REF_NAME }}-cache \
76
- --yes || true
104
+ # az acr repository delete \
105
+ # --name ${{ env.AZURE_CONTAINER_REGISTRY }} \
106
+ # --image ${{ github.event.repository.name }}:${{ matrix.platform}}-${{ steps.branch_name.outputs.GH_REF_NAME }}-cache \
107
+ # --yes || true
77
108
0 commit comments