Skip to content

Commit 913da7d

Browse files
authored
Speed up frontend CI (#2520)
* Switch to npm ci * Cache frontend build * Test non frontend change * Test frontend change * Reverse test frontend change
1 parent 20597ec commit 913da7d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,24 @@ jobs:
4242
working-directory: frontend
4343
steps:
4444
- uses: actions/checkout@v4
45+
- name: Restore cached build
46+
id: cache-build
47+
uses: actions/cache@v4
48+
with:
49+
path: frontend/build
50+
key: frontend-build-${{ hashFiles('frontend/**') }}
51+
restore-keys: |
52+
frontend-build-
4553
- name: Set up Node
54+
if: steps.cache-build.outputs.cache-hit != 'true'
4655
uses: actions/setup-node@v4
4756
with:
4857
node-version: 18
4958
- name: Install packages
50-
run: npm install
59+
if: steps.cache-build.outputs.cache-hit != 'true'
60+
run: npm ci
5161
- name: Build dist
62+
if: steps.cache-build.outputs.cache-hit != 'true'
5263
run: npm run build
5364
- name: Upload dist
5465
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
with:
3939
node-version: 18
4040
- name: Install packages
41-
run: npm install
41+
run: npm ci
4242
- name: Build dist
4343
run: npm run build
4444
- name: Upload dist

0 commit comments

Comments
 (0)