react.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: React
  2. on:
  3. workflow_dispatch:
  4. push:
  5. paths:
  6. - "ui/**"
  7. pull_request:
  8. paths:
  9. - "ui/**"
  10. branches:
  11. - master
  12. defaults:
  13. run:
  14. working-directory: ui
  15. jobs:
  16. build:
  17. name: Build
  18. runs-on: ubuntu-latest
  19. steps:
  20. - uses: actions/checkout@v2
  21. - uses: actions/setup-node@v2
  22. with:
  23. node-version: "14"
  24. - name: Cache node_modules
  25. uses: actions/cache@v2
  26. env:
  27. cache-name: cache-node-modules
  28. with:
  29. path: ~/.yarn
  30. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
  31. restore-keys: |
  32. ${{ runner.os }}-build-${{ env.cache-name }}-
  33. ${{ runner.os }}-build-
  34. ${{ runner.os }}-
  35. - name: Setup yarn
  36. run: yarn
  37. - name: Prettier
  38. run: yarn run prettier --check --ignore-unknown src
  39. - name: ESLint
  40. run: yarn run eslint --ext .js,.jsx,.ts,.tsx src
  41. - name: Build webui
  42. run: yarn build
  43. - name: Upload artifacts
  44. uses: actions/upload-artifact@v2
  45. with:
  46. name: webui
  47. path: ui/build/