generated from iamogbz/node-js-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (63 loc) · 1.69 KB
/
nodejs.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
64
65
66
67
68
name: Build
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v1
- name: Setup
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7
run_install: |
args: [--no-frozen-lockfile]
- name: Typecheck
run: |
pnpm build-types
pnpm link .
pnpm typecheck
- name: Lint
run: |
pnpm lint
- name: Test
env:
CI: true
run: |
pnpm test -- --ci --coverage
- name: Report
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
env:
COVERALLS_GIT_BRANCH: ${{ github.ref }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pnpm coveralls
- name: Build
run: |
pnpm build
cd ./demo
make build
cd ../
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: matrix.node-version == '18.x' && github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./demo/build
publish_branch: demo
- name: Release
if: matrix.node-version == '18.x' && github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm release