ci: add cleanup to CI to remove old tags

This commit is contained in:
Jens Langhammer 2020-05-27 17:33:27 +02:00
parent ee8a61d164
commit 084ff2994f
1 changed files with 38 additions and 0 deletions

38
.github/workflows/ci-cleanup.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: passbook-ci-cleanup
on:
- delete
jobs:
delete-server:
runs-on: ubuntu-latest
steps:
- name: Delete docker tag
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: curl
-u $DOCKER_USERNAME:$DOCKER_PASSWORD
-X "DELETE"
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/passbook/tags/${GITHUB_REF##*/}/"
delete-gatekeeper:
runs-on: ubuntu-latest
steps:
- name: Delete docker tag
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: curl
-u $DOCKER_USERNAME:$DOCKER_PASSWORD
-X "DELETE"
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/passbook-gatekeeper/tags/${GITHUB_REF##*/}/"
delete-static:
runs-on: ubuntu-latest
steps:
- name: Delete docker tag
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: curl
-u $DOCKER_USERNAME:$DOCKER_PASSWORD
-X "DELETE"
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/passbook-static/tags/${GITHUB_REF##*/}/"