Skip to content

Commit

Permalink
update caching strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
sserrata committed Aug 23, 2024
1 parent 928f00d commit 28b3a25
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/deploy-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,25 @@ jobs:
node-version: '20'
cache: 'yarn'

- name: Cache Docusaurus build
- name: Get yarn cache
id: yarn-cache
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
key: ${{ runner.os }}-pandev-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-pandev-
- name: Cache docusaurus build
uses: actions/cache@v4
with:
path: node_modules/.cache/webpack
key: pan-dev-build-live-${{ github.run_id }}
key: pandev-live-${{ github.run_id }}
restore-keys: |
pan-dev-build-live-
pandev-live
- name: Install dependencies
run: yarn --prefer-offline
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,25 @@ jobs:
node-version: '20'
cache: 'yarn'

- name: Cache Docusaurus build
- name: Get yarn cache
id: yarn-cache
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
key: ${{ runner.os }}-pandev-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-pandev-
- name: Cache docusaurus build
uses: actions/cache@v4
with:
path: node_modules/.cache/webpack
key: pan-dev-build-pr-${{ github.ref_name }}-${{ github.run_id }}
key: ${{ runner.os }}-pandev-pr-${{ github.event.number }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
pan-dev-build-pr-${{ github.ref_name }}-
${{ runner.os }}-pandev-pr-${{ github.event.number }}-
- name: Install dependencies
run: yarn --prefer-offline
Expand Down

0 comments on commit 28b3a25

Please sign in to comment.