From 31eccd5c091a7e4c9caf6f316bc729a5a4fa6246 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 16 Oct 2025 14:25:18 +0300 Subject: [PATCH] change cash --- .github/workflows/build.yaml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d481614..6a4b2ea 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -69,9 +69,10 @@ jobs: - name: Restore Docker layer cache uses: actions/cache/restore@v4 with: - path: /cache/buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + path: /cache/${{ github.repository }}/buildx-cache + key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }} restore-keys: | + ${{ runner.os }}-${{ github.repository }}-buildx- ${{ runner.os }}-buildx- - name: Build and push multi-arch image @@ -90,17 +91,18 @@ jobs: build-args: | GIT_COMMIT=${{ github.sha }} cache-from: | - type=local,src=/cache/buildx-cache + type=local,src=/cache/${{ github.repository }}/buildx-cache cache-to: | - type=local,dest=/cache/buildx-cache-new,mode=max + type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max - name: Move new cache if it exists if: always() run: | - if [ -d /cache/buildx-cache-new ]; then + mkdir -p /cache/${{ github.repository }} + if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then echo "Found new buildx cache, replacing old one..." - rm -rf /cache/buildx-cache - mv /cache/buildx-cache-new /cache/buildx-cache + rm -rf /cache/${{ github.repository }}/buildx-cache + mv /cache/${{ github.repository }}/buildx-cache-new /cache/${{ github.repository }}/buildx-cache else echo "No new buildx cache found, keeping old one." fi @@ -109,8 +111,8 @@ jobs: if: always() uses: actions/cache/save@v4 with: - path: /cache/buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + path: /cache/${{ github.repository }}/buildx-cache + key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }} - name: Notify (result) if: always()