Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized Github Actions deploy job caching #458

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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