File tree Expand file tree Collapse file tree 4 files changed +74
-21
lines changed Expand file tree Collapse file tree 4 files changed +74
-21
lines changed Original file line number Diff line number Diff line change 1+ name : Cache Node Modules
2+ on :
3+ pull_request :
4+ push :
5+ branches : [ main ]
6+ jobs :
7+ cache_node_modules :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Checkout repository code
11+ uses : actions/checkout@main
12+ - uses : actions/setup-node@main
13+ with :
14+ node-version : ' 14'
15+ - name : Cache node_modules
16+ id : cache-node-modules
17+ uses : actions/cache@main
18+ with :
19+ path : node_modules
20+ key : node_modules-${{ hashFiles('package-lock.json') }}
21+
22+ - name : Install dependencies
23+ if : steps.cache-node-modules.outputs.cache-hit != 'true'
24+ run : npm install
Original file line number Diff line number Diff line change 11name : Release
2-
32on :
43 push :
54 branches : [ main ]
6-
75jobs :
86 release :
97 name : Release
8+ needs : cache_node_modules
109 runs-on : ubuntu-latest
1110 steps :
12- - uses : actions/checkout@main
13- - uses : actions/setup-node@v1
11+ - name : Checkout repository code
12+ uses : actions/checkout@main
13+
14+ - name : Load node_modules
15+ id : cache-node-modules
16+ uses : actions/cache@main
1417 with :
15- node-version : " 12.x"
16- - run : npm install
18+ path : node_modules
19+ key : node_modules-${{ hashFiles('package-lock.json') }}
20+
21+ - name : Install node_modules
22+ if : steps.cache-node-modules.outputs.cache-hit != 'true'
23+ run : npm install
1724 - run : npm run generate
1825 - run : npm run test
1926 - run : npx semantic-release
Original file line number Diff line number Diff line change 11name : Build and Deploy
2- on : [push]
2+ on :
3+ push :
4+ branches : [ main ]
35jobs :
46 build-and-deploy :
7+ needs : cache_node_modules
58 runs-on : ubuntu-latest
69 env :
710 NODE_OPTIONS : ' --max_old_space_size=4096'
@@ -10,17 +13,29 @@ jobs:
1013 uses : actions/checkout@main
1114 with :
1215 persist-credentials : false
13- - name : Install and Build 🔧
16+
17+ - name : Load node_modules
18+ id : cache-node-modules
19+ uses : actions/cache@main
20+ with :
21+ path : node_modules
22+ key : node_modules-${{ hashFiles('package-lock.json') }}
23+
24+ - name : Install node_modules
25+ if : steps.cache-node-modules.outputs.cache-hit != 'true'
26+ run : npm install
27+
28+ - name : Build 🔧
1429 run : |
15- npm install
1630 npm run generate
1731 npm run storybook
1832 npm run build-storybook
33+
1934 - name : Deploy 🚀
20352136 with :
2237 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23- BRANCH : main # The branch the action should deploy to.
24- FOLDER : docs-build # The folder that the build-storybook script generates files.
25- CLEAN : true # Automatically remove deleted files from the deploy branch
26- TARGET_FOLDER : docs # The folder that we serve our Storybook files from
38+ BRANCH : main
39+ FOLDER : docs-build
40+ CLEAN : true
41+ TARGET_FOLDER : docs
Original file line number Diff line number Diff line change 1-
21name : Test
3-
42on :
53 pull_request :
64 push :
75 branches : [ main ]
8-
96jobs :
107 release :
118 name : Test
9+ needs : cache_node_modules
1210 runs-on : ubuntu-latest
1311 steps :
14- - uses : actions/checkout@main
15- - uses : actions/setup-node@v1
12+ - name : Checkout repository code
13+ uses : actions/checkout@main
14+
15+ - name : Load node_modules
16+ id : cache-node-modules
17+ uses : actions/cache@main
1618 with :
17- node-version : " 12.x"
18- - run : npm install
19+ path : node_modules
20+ key : node_modules-${{ hashFiles('package-lock.json') }}
21+
22+ - name : Install node_modules
23+ if : steps.cache-node-modules.outputs.cache-hit != 'true'
24+ run : npm install
25+
1926 - run : npm run generate
20- - run : npm run test
27+ - run : npm run test
You can’t perform that action at this time.
0 commit comments