Browse Source

use cache key depending on git sha

Sebastian Stenzel 5 years ago
parent
commit
830941755b
1 changed files with 2 additions and 4 deletions
  1. 2 4
      .github/workflows/build.yml

+ 2 - 4
.github/workflows/build.yml

@@ -18,7 +18,7 @@ jobs:
       - uses: actions/cache@v1
       - uses: actions/cache@v1
         with:
         with:
           path: ~/.m2/repository
           path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: ${{ runner.os }}-maven-${{ GITHUB_SHA }}
           restore-keys: |
           restore-keys: |
             ${{ runner.os }}-maven-
             ${{ runner.os }}-maven-
       - name: Build with Maven
       - name: Build with Maven
@@ -46,9 +46,7 @@ jobs:
       - uses: actions/cache@v1
       - uses: actions/cache@v1
         with:
         with:
           path: ~/.m2/repository
           path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-          restore-keys: |
-            ${{ runner.os }}-maven-
+          key: ${{ runner.os }}-maven-${{ GITHUB_SHA }}
       - name: Build with Maven
       - name: Build with Maven
         run: mvn -B package -DskipTests --file main/pom.xml --resume-from=buildkit -Prelease
         run: mvn -B package -DskipTests --file main/pom.xml --resume-from=buildkit -Prelease
       - name: Upload buildkit-linux.zip
       - name: Upload buildkit-linux.zip