Files
nabarr/.github/workflows/cleanup.yml
l3uddz da1b3201ba readme: add readme and docker builds to docker hub (#8)
* build: use docker hub

github container registry is too limiting (no api support for tag cleanup etc)

* readme: change table of contents
2021-02-14 19:38:23 +00:00

26 lines
767 B
YAML

name: Docker Cleanup
on: delete
jobs:
cleanup_branch:
if: startsWith(github.event.ref_type, 'branch') == true
runs-on: ubuntu-latest
steps:
- name: Sanitize branch docker tag
uses: frabert/replace-string-action@master
id: dockertag
with:
pattern: '[:\.\/]+'
string: "${{ github.event.ref }}"
replace-with: '-'
flags: 'g'
- name: Remove branch docker tag
shell: bash
env:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag: ${{ steps.dockertag.outputs.replaced }}
run: |
docker run --rm lumir/remove-dockerhub-tag --user "$username" --password "$password" cloudb0x/nabarr:$tag