-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.07 KB
/
publish.yaml
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
name: Release
on:
release:
types: [published]
permissions:
contents: read
pages: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
registry-url: https://registry.npmjs.org
# Capture the name of the published release to an environment variable
# See https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: npm install
# Modify package.json, inserting version attribute
- run: npm version $RELEASE_VERSION --no-git-tag-version
# Perform publish, which will also run prepublishOnly
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm run generate-docs
- uses: actions/upload-pages-artifact@v2
with:
path: 'docs/'
- uses: actions/deploy-pages@v2