Merge pull request #59 from Sotatek-HocNguyena/feat/reject-error #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package on npmjs | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
jobs: | |
publish: | |
environment: CI | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'release-please--branches--main')" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ⬇️ Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: 🔨 Install dependencies | |
run: npm ci --ignore-scripts | |
- name: 📦 Bundle package | |
run: npm run build | |
- name: 🫡 Configure npm | |
run: | | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc | |
- name: 🚀 Publish package on npmjs | |
run: npm publish | |
env: | |
NPM_TOKEN: ${{ secrets.NPMJS_SECRET }} |