-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.49 KB
/
npm-publish-beta.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
name: Build and Publish NPM Package
on:
push:
branches:
- develop
- main
jobs:
deploy-beta:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Build
run: npm ci && npm run build:prod
- name: Publish to npm (beta version)
run: npm run npm:publish:beta
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
deploy-release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Build
run: npm ci && npm run build:prod
- name: Publish to npm (release version)
run: npm run npm:publish:latest
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}