js.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: JS
  2. on:
  3. push:
  4. paths:
  5. - 'software/js'
  6. - 'proto'
  7. - '.github/workflows/js.yml'
  8. pull_request:
  9. paths:
  10. - 'software/js'
  11. - 'proto'
  12. - '.github/workflows/js.yml'
  13. workflow_dispatch:
  14. permissions:
  15. contents: read
  16. pages: write
  17. id-token: write
  18. # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
  19. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
  20. concurrency:
  21. group: "pages"
  22. cancel-in-progress: false
  23. jobs:
  24. # Build job
  25. build:
  26. runs-on: ubuntu-latest
  27. steps:
  28. - name: Checkout
  29. uses: actions/checkout@v3
  30. - name: Set up Node
  31. uses: actions/setup-node@v3
  32. with:
  33. node-version: 18
  34. - name: Install dependencies
  35. working-directory: software/js
  36. run: npm ci
  37. - name: Build
  38. working-directory: software/js
  39. run: PUBLIC_URL="/smartknob" npm run build
  40. - name: Setup Pages
  41. uses: actions/configure-pages@v3
  42. - name: Upload artifact
  43. uses: actions/upload-pages-artifact@v1
  44. with:
  45. path: './software/js/packages/example-webserial-timeline/build'
  46. # Deployment job
  47. deploy:
  48. environment:
  49. name: github-pages
  50. url: ${{ steps.deployment.outputs.page_url }}
  51. if: github.repository == 'scottbez1/smartknob' && github.ref == 'refs/heads/master'
  52. runs-on: ubuntu-latest
  53. needs: build
  54. steps:
  55. - name: Deploy to GitHub Pages
  56. id: deployment
  57. uses: actions/deploy-pages@v2