-
Notifications
You must be signed in to change notification settings - Fork 18
63 lines (50 loc) · 1.58 KB
/
ofnotes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: ofnotes
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "12.14"
- name: Restore Npm Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Check Code style
if: ${{ !contains(github.actor, 'dependabot') }}
run: npm run format:check
- name: Run Tests
run: npm run test -- --watchAll=false --coverage
- name: Upload coverage report
uses: codecov/codecov-action@v1.0.3
if: ${{ !contains(github.actor, 'dependabot') }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build
if: ${{ !contains(github.actor, 'dependabot') }}
run: |
npm i -g netlify-cli
netlify build
- name: Deploy Preview to Netlify
if: ${{ !contains(github.actor, 'dependabot') && github.event_name == 'pull_request' }}
run: netlify deploy --dir=./build
- name: Deploy Prod to Netlify
if: ${{ !contains(github.actor, 'dependabot') && github.event_name == 'push' }}
run: netlify deploy --dir=./build --prod