-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (89 loc) · 2.55 KB
/
ci-pipeline.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
NODE_VERSION: 16
PACKAGE_MANAGER: 'npm'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.PACKAGE_MANAGER }}
- name: Install dependecies
run: npm install
- run: npm run lint
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.PACKAGE_MANAGER }}
- name: Install dependencies
run: npm install
- run: npm run format:check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.PACKAGE_MANAGER }}
- name: Install dependencies
run: npm install
- run: npm run test
build:
runs-on: ubuntu-latest
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.PACKAGE_MANAGER }}
- name: Install dependencies
run: npm install
- name: build
run: npm run build
- name: Run lighthouse ci
run: |
npm install -g @lhci/[email protected]
lhci autorun --upload.token=${{ secrets.LHCI_BUILD_TOKEN }} --upload.serverBaseUrl=${{ secrets.LHCI_SERVER_BASE_URL}}
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.PACKAGE_MANAGER }}
- name: Install dependecies
run: npm install
- name: Publish to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: 'main'
onlyChanged: true
buildScriptName: 'storybook:build'