-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 2.06 KB
/
main.yml
File metadata and controls
81 lines (65 loc) · 2.06 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
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
name: Main
on: [push]
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
issues: write
jobs:
run-ci:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Build, test & deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Check types
run: npm run type-check
- name: Check linting
run: npm run lint
- name: Run tests
run: npm run test:ci
- name: Build storybook
# Check storybook build only for feature branches
if: github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/main'
run: npm run build-storybook
- name: Build package
run: npm run build
# Deploy and release only for develop and main branches
- name: Archive build artifacts
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Deploy Storybook
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.2
with:
install_command: npm ci
build_command: npm run build-storybook
path: storybook-static
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v3
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
with:
name: dist
path: dist
- name: Release
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --ci