Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
Till0196 committed Nov 13, 2024
1 parent 9ca95a0 commit 8a8bdd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,22 @@ jobs:
- name: Get latest cache key
id: cache-key
# 100MB以上かつ最も新しいキャッシュを取得
run: |
LATEST_CACHE_KEY=$(gh cache list --key cache-pkgs-${{ env.PLATFORM_PAIR }}- --json key,sizeInBytes,createdAt --jq '.[] | select(.sizeInBytes >= 100*1024*1024) | .key' | sort -r | head -n 1)
LATEST_CACHE_KEY=$(gh cache list --key cache-pkgs-${{ env.PLATFORM_PAIR }}- --json key,sizeInBytes,createdAt --jq '.[] | select(.sizeInBytes >= 100*1024*1024) | .key' | head -n 1)
echo "LATEST_CACHE_KEY=$LATEST_CACHE_KEY" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: latest cache key echo
- name: Echo latest cache key
run: |
echo $LATEST_CACHE_KEY
- name: Package Cache
id: cache
uses: actions/cache@v4
with:
# keyに固定値を指定するとキャッシュがアップロードされないので、現在の日時を指定
key: cache-pkgs-${{ env.PLATFORM_PAIR }}-${{ env.CURRENT_TIME }}
restore-keys: ${{ env.LATEST_CACHE_KEY }}
path: |
Expand Down

0 comments on commit 8a8bdd6

Please sign in to comment.