-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (57 loc) · 1.64 KB
/
release.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
name: Release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
node-version:
- 16
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
id: cache
with:
path: node_modules/
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('package*.json') }}
- run: npm ci --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
- run: npm test
- run: npm run lint
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci --ignore-scripts
- run: npm run build:docs
- name: Make GitHub links absolute
run: shopt -s globstar;
sed
--in-place
--expression='s:/develop/docs/:/${{ github.sha }}/docs/:g'
--expression='s:<img src="docs/assets/:<img src="media/:g'
docs/**/*.html;
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
# for v3.html and perhaps CNAME
keep_files: true
- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}