Skip to content

Commit 276b8ff

Browse files
authored
[test] Restore nextjs cache for size snapshot (#20155)
1 parent db2865a commit 276b8ff

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

azure-pipelines.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ trigger:
1010
pr:
1111
branches:
1212
include:
13-
- '*'
13+
- '*'
1414

1515
pool:
1616
vmImage: 'ubuntu-latest'
1717

18+
variables:
19+
DOCS_NEXT_CACHE_FOLDER: $(Build.SourcesDirectory)/docs/.next/cache
20+
1821
steps:
1922
- task: NodeTool@0
2023
inputs:
@@ -54,6 +57,15 @@ steps:
5457
artifactName: 'canaries'
5558
targetPath: 'material-ui-core.tgz'
5659

60+
- task: Cache@2
61+
inputs:
62+
key: 'yarn | "$(Agent.OS)" | yarn.lock'
63+
restoreKeys: |
64+
yarn | "$(Agent.OS)"
65+
yarn
66+
path: $(DOCS_NEXT_CACHE_FOLDER)
67+
displayName: Cache nextjs build
68+
5769
- script: |
5870
set -o pipefail
5971
mkdir -p scripts/sizeSnapshot/build

docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"author": "Material-UI Team",
66
"license": "MIT",
77
"scripts": {
8-
"build": "rimraf .next && cross-env NODE_ENV=production next build",
8+
"build": "cross-env NODE_ENV=production next build",
9+
"build:clean": "rimraf .next && yarn build",
910
"build-sw": "node ./scripts/buildServiceWorker.js",
1011
"dev": "rimraf ./node_modules/.cache/babel-loader && next dev",
1112
"deploy": "git push material-ui-docs master:latest",

0 commit comments

Comments
 (0)