.github/workflows/ci.yml
name: CI
on:
- push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Run build
run: npm run build
- uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Build documentation
if: github.ref == 'refs/heads/master'
run: npm run docs
- name: Publish documentation
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs