From 48cb881af01ae06571de581ac840ddb48b81fe6a Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Wed, 8 Apr 2026 11:21:24 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20perf:=20optimize=20cache=20check=20?= =?UTF-8?q?using=20docker=20manifest=20inspect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 5be9fce..03f8b4a 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -76,15 +76,18 @@ jobs: echo "Dependency hash: $DEPS_HASH" echo "deps_hash=$DEPS_HASH" >> $GITHUB_OUTPUT - - name: Check for existing cache + - name: Check for existing cache (optimized) id: check_cache run: | - # Check if image exists in registry + # Check if image exists in registry using optimized approach IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}-build-cache:${{ steps.calculate_hash.outputs.deps_hash }}" - # Try to pull the image to see if it exists - if docker pull "$IMAGE_NAME" >/dev/null 2>&1; then - echo "✅ Cache hit - using existing build cache" + # Fast check using docker manifest inspect (lighter than pull) + echo "🔍 Checking cache: $IMAGE_NAME" + + # Try manifest inspect first (fastest method) + if docker manifest inspect "$IMAGE_NAME" >/dev/null 2>&1; then + echo "✅ Cache hit - using existing build cache (manifest inspect)" echo "cache_hit=true" >> $GITHUB_OUTPUT else echo "⚠️ Cache miss - will build new cache image"