Skip to content

Commit 244eab4

Browse files
committed
Add github actions workflow
1 parent ab4b4e0 commit 244eab4

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/validate.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: validate
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["main"]
7+
8+
jobs:
9+
build:
10+
name: "Build"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: ⬇️ Checkout repo
14+
uses: actions/checkout@v2
15+
16+
- name: ⎔ Setup node
17+
uses: actions/setup-node@v1
18+
with:
19+
node_version: 14
20+
21+
- run: npm install
22+
- run: npm run lint
23+
- run: npm run check
24+
- run: npm run format
25+
- run: npm run coverage
26+
- run: npm run build -- --prod
27+
28+
- name: Upload artifacts
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: build
32+
path: |
33+
build
34+
35+
deploy:
36+
name: "Deploy"
37+
runs-on: ubuntu-latest
38+
needs: build
39+
steps:
40+
- name: ⤵️ Download build artifacts from build job
41+
uses: actions/download-artifact@v2
42+
with:
43+
name: build
44+
- uses: actions/checkout@v1
45+
- uses: netlify/actions/cli@master
46+
env:
47+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
48+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
49+
with:
50+
args: deploy --dir=build --prod
51+
secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]'
52+
53+
codecov:
54+
name: "Coverage"
55+
runs-on: ubuntu-latest
56+
needs: deploy
57+
steps:
58+
- uses: actions/checkout@master
59+
- uses: codecov/codecov-action@v1
60+
with:
61+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)