Delete branch tag from container registry #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delete tag from container registry | |
on: | |
delete: | |
env: | |
REGISTRY: cfaprdbatchcr.azurecr.io | |
IMAGE_NAME: pyrenew-hew | |
jobs: | |
delete-container: | |
runs-on: cfa-cdcgov | |
name: Deleting the container | |
steps: | |
- name : Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: branch-name | |
- name: Login to the Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: "cfaprdbatchcr.azurecr.io" | |
username: "cfaprdbatchcr" | |
password: ${{ secrets.CFAPRDBATCHCR_REGISTRY_PASSWORD }} | |
- name: Deleting the image | |
run: | | |
az acr repository delete \ | |
--name ${{ env.REGISTRY }} \ | |
--image ${{ env.IMAGE_NAME }}:${{ steps.branch-name.outputs.branch}} |