do not keep untagged dockers

This commit is contained in:
Vladimir Dubrovin 2026-05-31 13:10:26 +03:00
parent bdf9946fe5
commit 3dde2de498
2 changed files with 22 additions and 6 deletions

View File

@ -34,9 +34,10 @@ jobs:
echo "busybox=${IMAGE}:${RELEASE}.busybox,${IMAGE}:busybox" >> "$GITHUB_OUTPUT" echo "busybox=${IMAGE}:${RELEASE}.busybox,${IMAGE}:busybox" >> "$GITHUB_OUTPUT"
echo "full=${IMAGE}:${RELEASE},${IMAGE}:latest" >> "$GITHUB_OUTPUT" echo "full=${IMAGE}:${RELEASE},${IMAGE}:latest" >> "$GITHUB_OUTPUT"
else else
echo "minimal=${IMAGE}:devel.minimal" >> "$GITHUB_OUTPUT" DATETIME=$(date +%d%m%y%H%M%S)
echo "busybox=${IMAGE}:devel.busybox" >> "$GITHUB_OUTPUT" echo "minimal=${IMAGE}:${DATETIME}-devel.minimal,${IMAGE}:devel.minimal" >> "$GITHUB_OUTPUT"
echo "full=${IMAGE}:devel" >> "$GITHUB_OUTPUT" echo "busybox=${IMAGE}:${DATETIME}-devel.busybox,${IMAGE}:devel.busybox" >> "$GITHUB_OUTPUT"
echo "full=${IMAGE}:${DATETIME}-devel,${IMAGE}:devel" >> "$GITHUB_OUTPUT"
fi fi
- name: Set up QEMU - name: Set up QEMU
@ -60,6 +61,7 @@ jobs:
file: Dockerfile.minimal file: Dockerfile.minimal
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.minimal }} tags: ${{ steps.tags.outputs.minimal }}
- name: Build and push busybox - name: Build and push busybox
@ -69,6 +71,7 @@ jobs:
file: Dockerfile.busybox file: Dockerfile.busybox
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.busybox }} tags: ${{ steps.tags.outputs.busybox }}
- name: Build and push full - name: Build and push full
@ -78,4 +81,13 @@ jobs:
file: Dockerfile.full file: Dockerfile.full
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.full }} tags: ${{ steps.tags.outputs.full }}
- name: Delete untagged GHCR images
if: github.event_name != 'pull_request'
uses: actions/delete-package-versions@v5
with:
package-name: 3proxy
package-type: container
delete-untagged-versions: true

View File

@ -32,9 +32,10 @@ jobs:
echo "busybox=${REGISTRY}/${IMAGE_NAME}:${RELEASE}.busybox,${REGISTRY}/${IMAGE_NAME}:busybox" >> "$GITHUB_OUTPUT" echo "busybox=${REGISTRY}/${IMAGE_NAME}:${RELEASE}.busybox,${REGISTRY}/${IMAGE_NAME}:busybox" >> "$GITHUB_OUTPUT"
echo "full=${REGISTRY}/${IMAGE_NAME}:${RELEASE},${REGISTRY}/${IMAGE_NAME}:latest" >> "$GITHUB_OUTPUT" echo "full=${REGISTRY}/${IMAGE_NAME}:${RELEASE},${REGISTRY}/${IMAGE_NAME}:latest" >> "$GITHUB_OUTPUT"
else else
echo "minimal=${REGISTRY}/${IMAGE_NAME}:devel.minimal" >> "$GITHUB_OUTPUT" DATETIME=$(date +%d%m%y%H%M%S)
echo "busybox=${REGISTRY}/${IMAGE_NAME}:devel.busybox" >> "$GITHUB_OUTPUT" echo "minimal=${REGISTRY}/${IMAGE_NAME}:${DATETIME}-devel.minimal,${REGISTRY}/${IMAGE_NAME}:devel.minimal" >> "$GITHUB_OUTPUT"
echo "full=${REGISTRY}/${IMAGE_NAME}:devel" >> "$GITHUB_OUTPUT" echo "busybox=${REGISTRY}/${IMAGE_NAME}:${DATETIME}-devel.busybox,${REGISTRY}/${IMAGE_NAME}:devel.busybox" >> "$GITHUB_OUTPUT"
echo "full=${REGISTRY}/${IMAGE_NAME}:${DATETIME}-devel,${REGISTRY}/${IMAGE_NAME}:devel" >> "$GITHUB_OUTPUT"
fi fi
- name: Set up QEMU - name: Set up QEMU
@ -57,6 +58,7 @@ jobs:
file: Dockerfile.minimal file: Dockerfile.minimal
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.minimal }} tags: ${{ steps.tags.outputs.minimal }}
- name: Build and push busybox - name: Build and push busybox
@ -66,6 +68,7 @@ jobs:
file: Dockerfile.busybox file: Dockerfile.busybox
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.busybox }} tags: ${{ steps.tags.outputs.busybox }}
- name: Build and push full - name: Build and push full
@ -75,4 +78,5 @@ jobs:
file: Dockerfile.full file: Dockerfile.full
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.full }} tags: ${{ steps.tags.outputs.full }}