name: 🚀 Deploy to npm

on:
    push:
        tags:
            - 'v*'

jobs:
    publish:
        runs-on: ubuntu-latest

        steps:
            - name: 📥 Checkout repository
              uses: actions/checkout@v4

            - name: 🔧 Setup Node.js
              uses: actions/setup-node@v4
              with:
                  node-version: 22
                  registry-url: 'https://registry.npmjs.org/'

            - name: 📦 Install dependencies
              run: npm install

            - name: 🚀 Deploy to npm
              run: npm run deploy
              env:
                  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
