Skip to content

Commit

Permalink
Update npm-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mykhayloserdyuk authored May 10, 2024
1 parent eedfc64 commit 3482bf0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: Run Tests and Publish

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: [ main ]

jobs:
test:
build-and-publish:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,9 +16,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Publish to npm
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}

0 comments on commit 3482bf0

Please sign in to comment.