-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (37 loc) · 996 Bytes
/
cd.yml
File metadata and controls
41 lines (37 loc) · 996 Bytes
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: NPM Deployment
on:
release:
types: [released, prereleased]
permissions:
contents: read
id-token: write # Required to authenticate with npm
jobs:
docs:
uses: ./.github/workflows/docs.yml
secrets: inherit
permissions:
actions: read
pages: write
id-token: write
with:
deploy: true
publish:
environment: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test
- run: npm publish
if: ${{ !github.event.release.prerelease }}
# npm requires explicitly specifying a "tag" like `next` if the semantic version is a prerelease like `2.0.0-alpha1`
- run: npm publish --tag next
if: ${{ github.event.release.prerelease }}