Skip to content

Commit

Permalink
ci(image): Run untagged image cleanup after image publish
Browse files Browse the repository at this point in the history
Run cleanup as subsequent job dependent on image publishing.
  • Loading branch information
jidicula committed Mar 2, 2022
1 parent 11adc53 commit 81d2e6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/clang-format-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- '.github/workflows/clang-format-image.yml'
workflow_dispatch:
schedule:
- cron: '5 3 * * *'
- cron: '5 4 * * *' # Daily at 04:05

defaults:
run:
Expand All @@ -20,7 +20,7 @@ env:
IMAGE_NAME: clang-format

jobs:
get-binary:
publish-image:
name: clang-format ${{ matrix.version-pair.version }}
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -68,3 +68,15 @@ jobs:
build-args: |
"UBUNTU_VERSION=${{ matrix.version-pair.ubuntu }}"
"CLANG_FORMAT_VERSION=${{ matrix.version-pair.version }}"
clean-untagged-images:
needs: publish-image
name: Clean untagged images
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Install ghcr-cleaner
run: go install github.com/jidicula/ghcr-cleaner@latest
- name: Run ghcr-cleaner
run: ghcr-cleaner --token "${{ secrets.GHCR_DELETE_TOKEN }}" --packagename clang-format
27 changes: 0 additions & 27 deletions .github/workflows/stale-image-clean.yml

This file was deleted.

0 comments on commit 81d2e6c

Please sign in to comment.