add get-examples command #87
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: [ master ] | |
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 test | |
- name: Save npm package to branch | |
if: github.ref == 'refs/heads/master' | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add -f dist | |
git commit -m "Build npm package" | |
git push origin master:npm-publish --force |