Skip to content

Commit 18a65ed

Browse files
Cache dependencies in deploy workflows
This will reduce time spent installing dependencies from ~40s -> ~10s by caching.
1 parent 968ff96 commit 18a65ed

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
- name: Install Vercel CLI
16-
run: npm install --global vercel@latest
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
cache: 'yarn'
19+
- name: Install modules
20+
run: yarn
1721
- name: Pull Vercel Environment Information
1822
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
1923
- name: Build Project Artifacts

.github/workflows/deploy-prod.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Install Vercel CLI
15-
run: npm install --global vercel@latest
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
cache: 'yarn'
18+
- name: Install modules
19+
run: yarn
1620
- name: Pull Vercel Environment Information
1721
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
1822
- name: Build Project Artifacts

0 commit comments

Comments
 (0)