Skip to content

Commit 1a94140

Browse files
committed
chore: Create GH action to deploy package
1 parent 08bc1c6 commit 1a94140

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy release to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-to-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Set up node
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: '18'
17+
# Enables caching Yarn dependencies (uses https://github.com/actions/cache under the hood)
18+
cache: 'yarn'
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
23+
- name: Build the library
24+
run: yarn prepublishOnly
25+
26+
- name: Publish the library
27+
run: yarn publish --new-version ${{ github.event.release.tag_name }}
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
- name: setup git config
32+
run: |
33+
git config user.name "GitHub Actions Bot"
34+
git config user.email "<>"
35+
36+
- name: Commit files
37+
run: |
38+
git add package.json
39+
git commit -m "chore: Release ${{ github.event.release.tag_name }}"
40+
git push origin master

0 commit comments

Comments
 (0)