Keycloak
51 строка · 1.8 Кб
1name: Maven Cache2description: Caches Maven artifacts3
4inputs:5create-cache-if-it-doesnt-exist:6description: >7Only those callers which fill the cache with the right contents should set this to true to avoid creating a cache
8which contains too few or too many entries.
9required: false10default: false11
12runs:13using: composite14steps:15- id: weekly-cache-key16name: Key for weekly rotation of cache17shell: bash18run: echo "key=mvn-`date -u "+%Y-%U"`" >> $GITHUB_OUTPUT19
20- id: cache-maven-repository21name: Maven cache22uses: actions/cache@v323if: inputs.create-cache-if-it-doesnt-exist == 'true'24with:25# Two asterisks are needed to make the follow-up exclusion work26# see https://github.com/actions/toolkit/issues/713 for the upstream issue27path: |28~/.m2/repository/*/*
29!~/.m2/repository/org/keycloak
30key: ${{ steps.weekly-cache-key.outputs.key }}31
32- id: restore-maven-repository33name: Maven cache34uses: actions/cache/restore@v335if: inputs.create-cache-if-it-doesnt-exist == 'false'36with:37# Two asterisks are needed to make the follow-up exclusion work38# see https://github.com/actions/toolkit/issues/713 for the upstream issue39path: |40~/.m2/repository/*/*
41!~/.m2/repository/org/keycloak
42key: ${{ steps.weekly-cache-key.outputs.key }}43
44- name: Cache Maven Wrapper45uses: actions/cache@v346with:47path: .mvn/wrapper/maven-wrapper.jar48key: ${{ runner.os }}-maven-wrapper-${{ hashFiles('**/maven-wrapper.properties') }}49# use a previously cached JAR file as something else besides the version could have changed in the file50restore-keys: |51${{ runner.os }}-maven-wrapper-