diff --git a/.github/workflows/ci-publish.yml b/.github/workflows/ci-publish.yml new file mode 100644 index 0000000..9d5618c --- /dev/null +++ b/.github/workflows/ci-publish.yml @@ -0,0 +1,36 @@ +name: Publish to npm + +on: + push: + tags: + - "v*.*.*" + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + # Checkout the code + - name: Checkout repository + uses: actions/checkout@v3 + + # Set up Node.js + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + cache: "yarn" + + # Install dependencies + - name: Install dependencies + run: yarn install + + # Build the project + - name: Build the project + run: yarn build + + # Publish to npm + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}