Skip to content

feat: add CI/CD pipeline, Dependabot and build fixes #1

feat: add CI/CD pipeline, Dependabot and build fixes

feat: add CI/CD pipeline, Dependabot and build fixes #1

Workflow file for this run

name: Publish to npm
on:
pull_request:
types: [closed]
branches:
- production
jobs:
publish:
if: github.event.pull_request.merged == true
needs: ci
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Get package version
id: pkg
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.pkg.outputs.version }}
name: v${{ steps.pkg.outputs.version }}
body: |
Published from PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}
generate_release_notes: true
ci:
uses: ./.github/workflows/ci.yml