Skip to content

Commit 5e423af

Browse files
committed
updated job for clarity also added one to publish to npm
1 parent 92f155c commit 5e423af

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

.github/workflows/ci.yml .github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Node.js CI
1+
name: Build
22

33
on:
44
push:
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
20-
20+
2121
- name: Use Node.js 20.x
2222
uses: actions/setup-node@v4
2323
with:

.github/workflows/npm.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Use Node.js 20.x
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20.x
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
uses: borales/actions-yarn@v5
24+
with:
25+
cmd: install --immutable
26+
27+
- name: Prepare
28+
uses: borales/actions-yarn@v5
29+
with:
30+
cmd: prepare
31+
32+
- name: Pack
33+
uses: borales/actions-yarn@v5
34+
with:
35+
cmd: npm publish --access public
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pages.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
2+
name: Deploy docs to Pages
33

44
on:
55
# Runs on pushes targeting the default branch
@@ -50,13 +50,13 @@ jobs:
5050

5151
- name: Setup Pages
5252
uses: actions/configure-pages@v4
53-
53+
5454
- name: Upload artifact
5555
uses: actions/upload-pages-artifact@v3
5656
with:
5757
# Upload entire repository
5858
path: './docs'
59-
59+
6060
- name: Deploy to GitHub Pages
6161
id: deployment
6262
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)