Skip to content

Merge pull request #65 from FacturAPI/chore/webhook_type #4

Merge pull request #65 from FacturAPI/chore/webhook_type

Merge pull request #65 from FacturAPI/chore/webhook_type #4

Workflow file for this run

name: Deploy to npm
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Check if version exists
id: check-version
run: |
if npm view $(node -p "require('./package.json').name")@$(node -p "require('./package.json').version") > /dev/null 2>&1; then
echo "exists=true" >> $GITHUB_ENV
else
echo "exists=false" >> $GITHUB_ENV
fi
- name: Publish to npm
if: env.exists == 'false'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}