Skip to content

Commit

Permalink
chore: Create GH action to deploy package
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyDo committed Jan 12, 2023
1 parent 08bc1c6 commit 1a94140
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy-release-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy release to NPM

on:
release:
types: [published]

jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '18'
# Enables caching Yarn dependencies (uses https://github.com/actions/cache under the hood)
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build the library
run: yarn prepublishOnly

- name: Publish the library
run: yarn publish --new-version ${{ github.event.release.tag_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit files
run: |
git add package.json
git commit -m "chore: Release ${{ github.event.release.tag_name }}"
git push origin master

0 comments on commit 1a94140

Please sign in to comment.