Skip to content

Commit

Permalink
chore: npm deploy 스크립트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bytrustu committed Apr 22, 2024
1 parent 252f60d commit 97236a6
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to NPM

on:
push:
tags:
- 'v*'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Update package version
run: |
jq --arg v "$VERSION" '.version=$v' package.json > package.tmp.json
mv package.tmp.json package.json
- name: Run prepare and build
run: yarn prepare

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 97236a6

Please sign in to comment.