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"