Skip to content

Commit 4878f71

Browse files
committed
feat: add caching for Yarn dependencies and Turborepo in workflows
1 parent b767fb5 commit 4878f71

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/deploy-cloudflare-worker.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,27 @@ jobs:
3131
with:
3232
node-version: "22"
3333

34+
- name: Cache Yarn dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
.yarn/cache
39+
.yarn/unplugged
40+
.yarn/build-state.yml
41+
.yarn/install-state.gz
42+
node_modules
43+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-yarn-
46+
47+
- name: Cache Turborepo
48+
uses: actions/cache@v4
49+
with:
50+
path: .turbo
51+
key: ${{ runner.os }}-turbo-${{ github.sha }}
52+
restore-keys: |
53+
${{ runner.os }}-turbo-
54+
3455
- name: Install dependencies
3556
run: |
3657
corepack enable
@@ -88,3 +109,5 @@ jobs:
88109
READ_PERMISSION: ${{ secrets.READ_PERMISSION }}
89110
WRITE_PERMISSION: ${{ secrets.WRITE_PERMISSION }}
90111
ADMIN_PERMISSION: ${{ secrets.ADMIN_PERMISSION }}
112+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
113+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

.github/workflows/pages.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ jobs:
3535
with:
3636
node-version: "22"
3737

38+
- name: Cache Yarn dependencies
39+
uses: actions/cache@v4
40+
with:
41+
path: |
42+
.yarn/cache
43+
.yarn/unplugged
44+
.yarn/build-state.yml
45+
.yarn/install-state.gz
46+
node_modules
47+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-yarn-
50+
51+
- name: Cache Turborepo
52+
uses: actions/cache@v4
53+
with:
54+
path: .turbo
55+
key: ${{ runner.os }}-turbo-${{ github.sha }}
56+
restore-keys: |
57+
${{ runner.os }}-turbo-
58+
3859
- name: Install dependencies
3960
run: |
4061
corepack enable
@@ -59,6 +80,9 @@ jobs:
5980
# You can change the base path to your repository name
6081
run: |
6182
yarn build:client:env
83+
env:
84+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
85+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
6286

6387
- name: Upload pages artifact
6488
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)