File tree Expand file tree Collapse file tree 1 file changed +10
-43
lines changed Expand file tree Collapse file tree 1 file changed +10
-43
lines changed Original file line number Diff line number Diff line change 1
- name : Build
1
+ name : Build & Deploy
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - master
7
- pull_request :
8
- branches :
9
- - master
5
+ branches : [master]
10
6
workflow_dispatch :
11
7
12
8
jobs :
13
- build :
14
- name : Build
9
+ Build-Deploy :
15
10
runs-on : ubuntu-latest
16
11
17
12
steps :
18
13
- name : Checkout code
19
- uses : actions/checkout@v2
14
+ uses : actions/checkout@v3
20
15
21
16
- name : Set up Node.js
22
- uses : actions/setup-node@v1
17
+ uses : actions/setup-node@v3
23
18
with :
24
19
node-version : ' 16.6.1'
20
+ cache : npm
25
21
26
- - name : Cache Node.js modules
27
- uses : actions/cache@v2
28
- with :
29
- path : ~/.npm
30
- key : ${{ runner.OS }}-noder-${{ hashFiles('**/package-lock.json') }}
31
- restore-keys : |
32
- ${{ runner.OS }}-node-
33
- ${{ runner.OS }}-
34
-
35
- - name : Install dependencies
36
- run : CI=false npm install
37
-
38
- - name : Build project
39
- run : CI=false npm run build
40
-
41
- - name : Upload production-ready build files
42
- uses : actions/upload-artifact@v2
43
- with :
44
- name : production-files
45
- path : ./build
46
-
47
- deploy :
48
- name : Deploy
49
- needs : build
50
- runs-on : ubuntu-latest
51
- if : github.ref == 'refs/heads/master'
52
-
53
- steps :
54
- - name : Download artifact
55
- uses : actions/download-artifact@v2
56
- with :
57
- name : production-files
58
- path : ./build
22
+ - name : Build
23
+ run : |
24
+ CI=false npm install
25
+ CI=false npm run build
59
26
60
27
- name : Deploy to gh-pages
61
28
uses : peaceiris/actions-gh-pages@v3
You can’t perform that action at this time.
0 commit comments