@@ -3,18 +3,17 @@ name: Build & Publish Docs
33jobs :
44 build :
55 runs-on : ubuntu-latest
6- strategy :
7- matrix :
8- node-version : [16.x]
96 steps :
10- - uses : actions/checkout@v2
11- - name : Use Node.js ${{ matrix.node-version }}
12- uses : actions/setup-node@v2
7+ - uses : actions/checkout@v3
138 with :
14- node-version : ${{ matrix.node-version }}
9+ fetch-depth : 0
10+ - name : Setup Node.js
11+ uses : actions/setup-node@v3
12+ with :
13+ node-version : 16
1514 - name : npm install, build, and test
1615 run : |
17- npm i
16+ npm ci
1817 npm t
1918 npm run build
2019 env :
@@ -24,12 +23,40 @@ jobs:
2423 uses : coverallsapp/github-action@master
2524 with :
2625 github-token : ${{ secrets.GITHUB_TOKEN }}
26+ - uses : actions/upload-artifacts@master
27+ with :
28+ name : bundle
29+ path : pkg
2730 checkChangesInDocs :
2831 name : Check changes in docs
2932 runs-on : ubuntu-latest
3033 steps :
31- - uses : actions/checkout@master
34+ - uses : actions/checkout@v3
35+ with :
36+ fetch-depth : 0
3237 - name : Check changes in stories
3338 uses : netlify/actions/diff-includes@master
3439 with :
3540 args : docs
41+ release :
42+ name : Release
43+ runs-on : ubuntu-latest
44+ if : github.ref === 'refs/heads/main'
45+ steps :
46+ - uses : actions/checkout@v3
47+ with :
48+ fetch-depth : 0
49+ - name : Setup Node.js
50+ uses : actions/setup-node@v3
51+ with :
52+ node-version : 16
53+ run : npm ci
54+ - name : Release
55+ uses : actions/download-artifact@master
56+ with :
57+ name : bundle
58+ path : pkg
59+ env :
60+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
62+ run : npx semantic-release
0 commit comments