* build: use docker hub github container registry is too limiting (no api support for tag cleanup etc) * readme: change table of contents
26 lines
767 B
YAML
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 |