From 84de8cc0377add934abed13b7441e2b1d41012d8 Mon Sep 17 00:00:00 2001 From: Nick Jansen Date: Tue, 6 Feb 2024 09:09:40 +0000 Subject: [PATCH] Update cache scoping in GitHub Action workflows This commit modifies the cache scoping in the GitHub Actions workflow file to be specific to the target and PHP version. This change improves the cache handling by ensuring that each PHP version's cache for a specific target is unique, thus avoiding potential conflicts between different versions. --- .github/workflows/build-and-test-job.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test-job.yml b/.github/workflows/build-and-test-job.yml index c6b1abf..5cf3e63 100644 --- a/.github/workflows/build-and-test-job.yml +++ b/.github/workflows/build-and-test-job.yml @@ -55,8 +55,8 @@ jobs: load: true target: ${{ inputs.target }} tags: ghcr.io/sitepilot/php-${{ inputs.target }}:build - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=gha,scope=php-${{ inputs.target }}-${{ matrix.php }} + cache-to: type=gha,mode=max,scope=php-${{ inputs.target }}-${{ matrix.php }} build-args: | PHP_VERSION=${{ matrix.php }} @@ -73,8 +73,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=gha,scope=php-${{ inputs.target }}-${{ matrix.php }} + cache-to: type=gha,mode=max,scope=php-${{ inputs.target }}-${{ matrix.php }} provenance: false build-args: | PHP_VERSION=${{ matrix.php }}