1
- name : Build on push
2
- on :
3
- push :
4
- branches : [master]
5
- workflow_dispatch :
1
+ name : Build
2
+ on : [push, pull_request]
3
+
6
4
jobs :
7
5
gatsby-build :
8
- runs-on : ubuntu-20.04
6
+ runs-on : ubuntu-latest
9
7
steps :
10
- - uses : actions/checkout@v2
8
+ - uses : actions/checkout@v3
9
+ - uses : actions/setup-node@v3
10
+ with :
11
+ node-version : 18
12
+ cache : ' npm'
11
13
- name : Removing locks
12
14
run : rm package-lock.json
13
15
- name : Install dependencies
@@ -18,17 +20,17 @@ jobs:
18
20
CXXFLAGS="--std=c++14" npm install
19
21
npm run build
20
22
- name : Upload public dir as artifact
21
- uses : actions/upload-artifact@v2
23
+ uses : actions/upload-artifact@v3
22
24
with :
23
25
name : public-dir
24
26
path : public/
25
27
gen-og-images :
26
- runs-on : ubuntu-20.04
28
+ runs-on : ubuntu-latest
27
29
steps :
28
- - uses : actions/checkout@v2
30
+ - uses : actions/checkout@v3
29
31
- uses : actions/setup-node@v3
30
32
with :
31
- node-version : 16
33
+ node-version : 18
32
34
cache : ' npm'
33
35
- name : Build files
34
36
run : |
@@ -37,22 +39,27 @@ jobs:
37
39
npm run build
38
40
node gen-opengraph-images.js
39
41
- name : Upload files
40
- uses : actions/upload-artifact@v2
42
+ uses : actions/upload-artifact@v3
41
43
with :
42
44
name : og-images
43
45
path : scripts/genOGImages/dist/members/
44
46
deploy-build :
45
47
needs : [gen-og-images, gatsby-build]
46
- runs-on : ubuntu-20.04
48
+ if : ${{ success() && github.ref == 'refs/heads/master' }}
49
+ runs-on : ubuntu-latest
47
50
steps :
48
- - uses : actions/checkout@v2
51
+ - uses : actions/checkout@v3
52
+ - uses : actions/setup-node@v3
53
+ with :
54
+ node-version : 18
55
+ cache : ' npm'
49
56
- name : get public dir
50
- uses : actions/download-artifact@v2
57
+ uses : actions/download-artifact@v3
51
58
with :
52
59
name : public-dir
53
60
path : public
54
61
- name : get og-images dir
55
- uses : actions/download-artifact@v2
62
+ uses : actions/download-artifact@v3
56
63
with :
57
64
name : og-images
58
65
path : public/og/members/
0 commit comments