update readme #10
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: Build npm package | |
on: | |
push: | |
branches: [ main ] | |
permissions: | |
contents: write | |
env: | |
node-version: 18.x | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ env.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: Save npm package to branch | |
if: github.ref == 'refs/heads/main' | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add -f lib | |
git commit -m "Build npm package" | |
git push origin main:npm-publish --force |