Skip to content

Commit b7f50e7

Browse files
committed
perf: add gh-delete-branch
1 parent 77b6076 commit b7f50e7

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "GitHub: Delete Branch"
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
az-acr-delete:
8+
name: 'Azure: Delete Branch Images'
9+
runs-on: ubuntu-latest
10+
environment: dev
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 }}
15+
strategy:
16+
matrix:
17+
platform: [amd64, arm64]
18+
steps:
19+
- name: Azure Cloud Login
20+
uses: Azure/login@v2
21+
with:
22+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
23+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
24+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
25+
26+
- name: Delete Branch Container Image
27+
uses: azure/cli@v2
28+
with:
29+
inlineScript: |
30+
az acr repository delete \
31+
--name ${{ env.AZURE_CONTAINER_REGISTRY }} \
32+
--image ${{ github.event.repository.name }}:${{ matrix.platform}}-${{ github.ref_name }} \
33+
--yes
34+
35+
gh-delete-branch:
36+
name: 'GitHub: Delete Branch'
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Delete Branch
43+
shell: bash
44+
run: git push origin --delete ${{ github.ref }}

.github/workflows/validate_release.yml renamed to .github/workflows/gh_validate_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55

66
jobs:
7-
validate-release:
7+
gh-validate-release:
88
name: 'GitHub: Validate Release'
99
runs-on: ubuntu-latest
1010
steps:

az/.gitkeep

Whitespace-only changes.

gh/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)