-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (91 loc) · 2.66 KB
/
Copy pathmain.yml
File metadata and controls
91 lines (91 loc) · 2.66 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build and Release
on: ['push']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10', '12', '14']
name: Node v${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v2
id: cache
with:
path: ./node_modules
key: ${{ runner.os }}-v2-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v2-node-${{ matrix.node }}-
- run: npm install
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run test:prod
- run: npm run build
- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.test_number }}
parallel: true
finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
docs:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/cache@v2
id: cache
with:
path: ./node_modules
key: ${{ runner.os }}-v2-node-12-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v2-node-12-
- run: npm install
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run docs
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/cache@v2
id: cache
with:
path: ./node_modules
key: ${{ runner.os }}-v2-node-12-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v2-node-12-
- run: npm install
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run build
- run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}