Skip to content

Commit

Permalink
Optimized Github Actions deploy job caching (#458)
Browse files Browse the repository at this point in the history
These have additional dependencies.
  • Loading branch information
freemanjp committed Mar 27, 2022
1 parent 7fd6098 commit 1866a64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache multiple paths
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -81,13 +81,15 @@ jobs:
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache multiple paths
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
!~/.m2/repository/com/github/gantsign/maven
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}-deploy
restore-keys: |
${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache multiple paths
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -81,13 +81,15 @@ jobs:
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache multiple paths
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
!~/.m2/repository/com/github/gantsign/maven
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}-deploy
restore-keys: |
${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
Expand Down Expand Up @@ -128,13 +130,15 @@ jobs:
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache multiple paths
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
!~/.m2/repository/com/github/gantsign/maven
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}-deploy-site
restore-keys: |
${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
- name: Configure Git user
run: >-
git config --global user.name 'John Freeman' &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache multiple paths
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
Expand Down

0 comments on commit 1866a64

Please sign in to comment.