-
-
Notifications
You must be signed in to change notification settings - Fork 7
112 lines (110 loc) · 2.89 KB
/
publish.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
name: Publish
on:
push:
tags:
- '*'
jobs:
secrets:
name: Secrets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm ci
- name: Scan for secrets
uses: evanextreme/[email protected]
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm ci
- name: Lint the codebase
run: npm run lint
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test:ci
- name: Upload coverage
uses: actions/upload-artifact@v1
with:
name: test_coverage
path: coverage
build_storybook:
name: Storybook Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm ci
- name: Build storybook
run: npm run storybook:build
- name: Upload the storybook
uses: actions/upload-artifact@v1
with:
name: storybook
path: docs
docs:
needs: build_storybook
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm ci
- name: Download storybook
uses: actions/download-artifact@v1
with:
name: storybook
path: docs
- name: Deploy Storybook to GitHub Pages
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: 'gh-pages'
build_dir: docs
committer_name: 'GitHub Action'
committer_email: '[email protected]'
commit_message: 'Update the Storybook on GitHub Pages'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_PAT: '${{ secrets.GH_PAT }}'
publish:
needs: [secrets, lint, test, build_storybook]
name: Publish to npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm ci
- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
NPM_TOKEN: '${{ secrets.NPM_AUTH_TOKEN }}'
update_changelog:
needs: [publish]
name: Update changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Generate changelog
uses: ahmadawais/[email protected]
with:
github_token: '${{ secrets.GH_PAT }}'