From c736268c87c05725a5dffbe1f07d285ee639d38d Mon Sep 17 00:00:00 2001 From: Denis Shatskiy Date: Fri, 8 Aug 2025 09:29:12 +0700 Subject: [PATCH] chore: Update Docker publish workflow to use inline caching and simplify old image cleanup process --- .gitea/workflows/docker-publish-fast.yml | 26 ++---------------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/docker-publish-fast.yml b/.gitea/workflows/docker-publish-fast.yml index 4987fc1..6d5c958 100644 --- a/.gitea/workflows/docker-publish-fast.yml +++ b/.gitea/workflows/docker-publish-fast.yml @@ -36,9 +36,8 @@ jobs: push: true platforms: linux/amd64 cache-from: | - type=registry,ref=git.shts.su/${{ gitea.repository }}:tabler-fast-buildcache type=registry,ref=git.shts.su/${{ gitea.repository }}:tabler-fast - cache-to: type=registry,ref=git.shts.su/${{ gitea.repository }}:tabler-fast-buildcache,mode=max + cache-to: type=inline tags: | git.shts.su/${{ gitea.repository }}:tabler-fast git.shts.su/${{ gitea.repository }}:tabler-fast-${{ gitea.sha }} @@ -54,25 +53,4 @@ jobs: - name: Cleanup old images run: | - # Get list of all tabler-fast images, sorted by creation date (newest first) - IMAGES=$(curl -s -H "Authorization: Bearer ${{ secrets.ACTIONS_PAT }}" \ - "https://git.shts.su/api/v1/repos/${{ gitea.repository }}/tags?page=1&limit=100" | \ - jq -r '.[] | select(.name | startswith("tabler-fast-")) | .name' | \ - sort -r) - - # Keep only the 3 most recent images - KEEP_COUNT=3 - COUNT=0 - - echo "$IMAGES" | while read -r tag; do - if [ -n "$tag" ]; then - COUNT=$((COUNT + 1)) - if [ $COUNT -gt $KEEP_COUNT ]; then - echo "Deleting old image: $tag" - curl -X DELETE -H "Authorization: Bearer ${{ secrets.ACTIONS_PAT }}" \ - "https://git.shts.su/api/v1/repos/${{ gitea.repository }}/tags/$tag" - else - echo "Keeping image: $tag" - fi - fi - done \ No newline at end of file + echo "Skipping container registry cleanup (inline cache in image). Keep 3 latest image tags logic can be added with regctl if needed." \ No newline at end of file