node.js.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
  3. name: CI
  4. on:
  5. push:
  6. branches: [main]
  7. pull_request:
  8. branches: [main]
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. node-version: [14.x]
  15. # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
  16. steps:
  17. - uses: actions/checkout@v2
  18. - name: Use Node.js ${{ matrix.node-version }}
  19. uses: actions/setup-node@v1
  20. with:
  21. node-version: ${{ matrix.node-version }}
  22. - run: npm ci
  23. - run: npm run build --if-present
  24. - run: npm run lint
  25. - run: npm run coverage
  26. - run: npm run build:example
  27. - name: Coveralls
  28. uses: coverallsapp/github-action@master
  29. with:
  30. github-token: ${{ secrets.GITHUB_TOKEN }}
  31. - name: Deploy
  32. if: ${{ github.ref == 'refs/heads/main' }}
  33. uses: peaceiris/actions-gh-pages@v3
  34. with:
  35. github_token: ${{ secrets.GITHUB_TOKEN }}
  36. publish_dir: ./example