doc setup added #7
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: Release npm Package | |
# Trigger the workflow on push to the "main" branch | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
# Step 1: Check out the code from the repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js environment | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.17.0' | |
cache: 'npm' | |
registry-url: 'https://registry.npmjs.org' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Step 4: Run tests | |
- name: Run tests | |
run: npm test | |
# Step 5: Publish to npm if tests pass | |
- name: Publish to npm | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |