Skip to content

Commit db46b1e

Browse files
author
pr0fix
committed
patch create npm deployment pipeline
1 parent 848194d commit db46b1e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/pipeline.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deployment Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches: [main]
9+
types: [opened, synchronize]
10+
11+
jobs:
12+
deployment_pipeline:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: "20"
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Run unit-tests
27+
run: npm run test
28+
29+
- name: Run build
30+
run: npm run build
31+
32+
- name: Version based on commit message
33+
if: ${{ github.event_name == 'push' }}
34+
id: versioning
35+
uses: phips28/[email protected]
36+
with:
37+
minor-wording: 'minor'
38+
major-wording: 'major'
39+
patch-wording: 'patch,fix'
40+
rc-wording: 'rc,alpha,beta'
41+
skip-tag: 'true'
42+
default: 'patch'
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Publish to npm
47+
if: ${{ github.event_name == 'push' }}
48+
run: npm publish --access public
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)