-
Notifications
You must be signed in to change notification settings - Fork 35
138 lines (129 loc) · 3.75 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- '*-dev'
jobs:
semantic:
name: Validate PR title
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
audit:
name: audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Test
run: ./scripts/audit.sh
tests:
name: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build icons
run: yarn build:icons
- name: Build presets
run: yarn build:presets
- name: Test
run: yarn test
size:
name: size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build presets
run: yarn dist:presets
- name: Test
run: yarn size-limit
deploy-pull-request-preview:
name: Deploy Preview
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build icons
run: yarn build:icons
- name: Package application
run: yarn dist
- uses: jpoehnelt/reusable-workspace/save@v1
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
alias: ecl-preview-${{ github.event.number }}
publish-dir: 'dist/website'
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY: true
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
chromatic-ec:
name: Run Chromatic for EC
needs: deploy-pull-request-preview
runs-on: ubuntu-latest
steps:
- uses: jpoehnelt/reusable-workspace/restore@v1
- uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: dist/website/playground/ec
chromatic-eu:
name: Run Chromatic for EU
needs: deploy-pull-request-preview
runs-on: ubuntu-latest
steps:
- uses: jpoehnelt/reusable-workspace/restore@v1
- uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN_EU }}
storybookBuildDir: dist/website/playground/eu
deploy-release-branch:
name: Deploy Release Branch
runs-on: ubuntu-latest
if: github.event_name == 'push' && endsWith(github.ref, '-dev')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build icons
run: yarn build:icons
- name: Package application
run: yarn dist
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
alias: ${{ github.ref_name }}
publish-dir: 'dist/website'
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY: true
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}