1+ name : CI
2+
3+ on :
4+ push :
5+ pull_request :
6+ types :
7+ - opened
8+ - synchronize
9+
10+ jobs :
11+
12+ lint :
13+ name : Lint
14+ runs-on : ubuntu-latest
15+ if : github.event_name == 'push'
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@master
19+
20+ - name : Install dependencies
21+ run : yarn install --frozen-lockfile
22+
23+ - name : Lint
24+ run : yarn lint
25+
26+ test :
27+ name : Test
28+ runs-on : ubuntu-latest
29+ if : github.event_name == 'push'
30+ steps :
31+ - name : Checkout repository
32+ uses : actions/checkout@master
33+
34+ - name : Install dependencies
35+ run : yarn install --frozen-lockfile
36+
37+ - name : Test
38+ run : yarn test
39+ env :
40+ CI : true
41+
42+ deployDraft :
43+ name : Deploy draft to Netlify
44+ runs-on : ubuntu-latest
45+ if : github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
46+ steps :
47+ - name : Checkout repository
48+ uses : actions/checkout@v1
49+
50+ - name : Install
51+ run : yarn install --frozen-lockfile
52+
53+ - name : Build action
54+ run : yarn build
55+
56+ - name : Generate simple HTML document
57+ run : |
58+ mkdir -p example
59+ echo -e "<pre>$(date -u)\n$GITHUB_SHA\n$GITHUB_REF</pre>" > example/index.html
60+
61+ - name : Test action
62+ uses : ./
63+ with :
64+ github-token : ${{ secrets.GITHUB_TOKEN }}
65+ netlify-auth-token : ${{ secrets.NETLIFY_AUTH_TOKEN }}
66+ netlify-site-id : ${{ secrets.NETLIFY_SITE_ID }}
67+ build-dir : ' ./example'
68+ draft : true
69+ comment-on-pull-request : true
70+
71+ deployProduction :
72+ name : Deploy production to Netlify
73+ runs-on : ubuntu-latest
74+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
75+ steps :
76+ - name : Checkout repository
77+ uses : actions/checkout@v1
78+
79+ - name : Install
80+ run : yarn install --frozen-lockfile
81+
82+ - name : Build action
83+ run : yarn build
84+
85+ - name : Generate simple HTML document
86+ run : |
87+ mkdir -p example
88+ echo -e "<pre>$(date -u)\n$GITHUB_SHA\n$GITHUB_REF</pre>" > example/index.html
89+
90+ - name : Test action
91+ uses : ./
92+ with :
93+ github-token : ${{ secrets.GITHUB_TOKEN }}
94+ netlify-auth-token : ${{ secrets.NETLIFY_AUTH_TOKEN }}
95+ netlify-site-id : ${{ secrets.NETLIFY_SITE_ID }}
96+ build-dir : ' ./example'
97+ comment-on-commit : true
0 commit comments