File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,14 +72,25 @@ jobs:
7272 -DrepoToken=${COVERALLS_SECRET} -DpullRequest=${{ github.event.number }}
7373 jacoco:report coveralls:report
7474
75- # We don't want to cache the WAR file, so delete it
76- - run : rm -rf ~/.m2/repository/edu/harvard/iq/dataverse
75+ # Prepare to replace the cache. Also: we don't want to cache the WAR file, so delete it
76+ - id : clear-cache
77+ if : ${{ steps.restore-m2-cache.outputs.cache-hit }}
78+ continue-on-error : true # This is not crucial, just carry on
79+ env :
80+ GH_TOKEN : ${{ github.token }}
81+ run : |
82+ rm -rf ~/.m2/repository/edu/harvard/iq/dataverse
83+
84+ gh extension install actions/gh-actions-cache
85+ gh actions-cache delete ${{ steps.restore-m2-cache.outputs.cache-primary-key }} --confirm
86+
7787 # To cache built Maven submodules, summon the save to cache action
7888 - name : Save Maven packages in Cache
7989 uses : actions/cache/save@v3
90+ if : always() # Try to save cache, will not fail if key still exists because clean failed
8091 with :
8192 path : ~/.m2
82- key : ${{ steps.restore-m2-cache.outputs.cache-primary-key }}-${{ github.run_id }}
93+ key : ${{ steps.restore-m2-cache.outputs.cache-primary-key }}
8394 push-app-img :
8495 name : Publish App Image
8596 permissions :
You can’t perform that action at this time.
0 commit comments