-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (51 loc) · 1.24 KB
/
ci.yml
File metadata and controls
51 lines (51 loc) · 1.24 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
name: CI
on:
push:
branches:
- main
paths-ignore:
- "README.md"
pull_request:
paths-ignore:
- "README.md"
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install dependencies
run: |
n=0
until [ $n -ge 3 ]
do
yarn install && echo "done" && break
n=$((n+1))
echo "Retry $n/3..."
sleep 15
done
- name: Build
run: yarn build
- name: Lint
run: yarn lint
- name: Docs
run: yarn gh-pages
- name: Test
run: node_modules/.bin/serve --listen 3000 gh-pages/ & yarn test
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages
- name: Publish npm
if: github.event_name == 'push'
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}