Skip to content

Commit

Permalink
Update delete.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Drazzilb08 committed Feb 15, 2024
1 parent f046ddd commit 00429bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ on:
jobs:
delete:
runs-on: ubuntu-latest

steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Delete Docker Image from GHCR
run: |
docker login --username ${{ secrets.GH_USERNAME }} --password ${{ secrets.GH_TOKEN }} ghcr.io
docker image rm ghcr.io/drazzilb08/userscripts:${{ github.ref_slug }}
docker image rm ghcr.io/drazzilb08/userscripts:${{ steps.extract_branch.outputs.branch }}
docker logout ghcr.io
- name: Delete Docker Image from Docker
run: |
docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }}
docker image rm ${{ secrets.DOCKER_USERNAME }}/userscripts:${{ github.ref_slug }}
docker image rm ${{ secrets.DOCKER_USERNAME }}/userscripts:${{ steps.extract_branch.outputs.branch }}
docker logout

0 comments on commit 00429bb

Please sign in to comment.