7
7
- main # change this if your default branch is named differently
8
8
workflow_dispatch :
9
9
10
+ permissions : {}
11
+
10
12
jobs :
11
13
analyze :
12
14
runs-on : ubuntu-latest
13
15
steps :
14
- - uses : actions/checkout@v2
16
+ - uses : actions/checkout@v4
15
17
16
18
- name : Set up node
17
- uses : actions/setup-node@v1
19
+ uses : actions/setup-node@v4
18
20
with :
19
21
node-version : ' 20.x'
22
+ cache : yarn
23
+ cache-dependency-path : yarn.lock
24
+
25
+ - name : Restore cached node_modules
26
+ uses : actions/cache@v4
27
+ with :
28
+ path : ' **/node_modules'
29
+ key : node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
20
30
21
- - name : Install dependencies
22
- uses : bahmutov/npm- install@v1.7.10
31
+ - name : Install deps
32
+ run : yarn install --frozen-lockfile
23
33
24
34
- name : Restore next build
25
- uses : actions/cache@v2
35
+ uses : actions/cache@v4
26
36
id : restore-build-cache
27
37
env :
28
38
cache-name : cache-next-build
@@ -41,13 +51,13 @@ jobs:
41
51
run :
npx -p [email protected] report
42
52
43
53
- name : Upload bundle
44
- uses : actions/upload-artifact@v2
54
+ uses : actions/upload-artifact@v4
45
55
with :
46
56
path : .next/analyze/__bundle_analysis.json
47
57
name : bundle_analysis.json
48
58
49
59
- name : Download base branch bundle stats
50
- uses : dawidd6/action-download-artifact@v2
60
+ uses : dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
51
61
if : success() && github.event.number
52
62
with :
53
63
workflow : analyze.yml
73
83
run : ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
74
84
75
85
- name : Upload analysis comment
76
- uses : actions/upload-artifact@v2
86
+ uses : actions/upload-artifact@v4
77
87
with :
78
88
name : analysis_comment.txt
79
89
path : .next/analyze/__bundle_analysis_comment.txt
82
92
run : echo ${{ github.event.number }} > ./pr_number
83
93
84
94
- name : Upload PR number
85
- uses : actions/upload-artifact@v2
95
+ uses : actions/upload-artifact@v4
86
96
with :
87
97
name : pr_number
88
98
path : ./pr_number
0 commit comments