-
Notifications
You must be signed in to change notification settings - Fork 2.2k
80 lines (78 loc) · 2.06 KB
/
ci.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
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
check-latest: true
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package.json') }}
- name: npm install
run: npm i
- name: Biome
run: npm run biome:ci
- name: ESLint
run: npm run eslint
- name: Prettier
run: npm run prettier:check
- name: Typecheck
run: npm run typecheck
- name: Bundle
run: |
npm run build
npm run build:types
- name: Test
run: npm t
timeout-minutes: 4
- uses: codecov/codecov-action@v3
website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
check-latest: true
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package.json') }}
- uses: actions/cache@v3
with:
path: node_modules/.cache
key: build-${{ hashFiles('package.json') }}
- name: Build
run: |
npm i
npm run build:website
- name: Set up git user
if: github.event_name == 'push'
run: |
git config --global user.email 'action@github.com'
git config --global user.name 'GitHub Action'
- name: Deploy gh-pages
if: github.ref == 'refs/heads/main'
run: |
git fetch origin gh-pages
git worktree add gh-pages gh-pages
cd gh-pages
git rm -r .
git checkout gh-pages -- old
mv ../dist/* .
git add .
git commit -m "gh-pages deployment" || echo "Nothing to commit"
git push -f https://adazzle:${{secrets.GITHUB_TOKEN}}@github.com/adazzle/react-data-grid.git