You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

67 lines
1.8 KiB

  1. name: Publish docs & Build dashboard
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. changes:
  8. runs-on: ubuntu-latest
  9. outputs:
  10. docs: ${{ steps.filter.outputs.docs }}
  11. dashboard: ${{ steps.filter.outputs.dashboard }}
  12. steps:
  13. - name: Checkout 🛎️
  14. uses: actions/checkout@v2
  15. with:
  16. persist-credentials: false
  17. - name: Check for changes 🎯
  18. uses: dorny/paths-filter@v2
  19. id: filter
  20. with:
  21. filters: |
  22. docs:
  23. - 'docs/**'
  24. dashboard:
  25. - 'src/DotNetCore.CAP.Dashboard/wwwroot/src/**'
  26. build-dashbaord-and-push:
  27. needs: changes
  28. if: ${{ needs.changes.outputs.dashboard == 'true' }}
  29. runs-on: ubuntu-latest
  30. defaults:
  31. run:
  32. working-directory: src/DotNetCore.CAP.Dashboard/wwwroot
  33. steps:
  34. - name: Checkout 🛎️
  35. uses: actions/checkout@v2
  36. with:
  37. persist-credentials: false
  38. - name: Use Node.js 🥽
  39. uses: actions/setup-node@v1
  40. with:
  41. node-version: '14.x'
  42. - name: Install dependencies 🧵
  43. run: npm install
  44. - name: Build to dist 🧨
  45. run: npm run build
  46. - name: Commit & Push dist changes 🚀
  47. uses: actions-js/push@master
  48. with:
  49. github_token: ${{ secrets.GITHUB_TOKEN }}
  50. build-docs-and-deploy:
  51. needs: changes
  52. if: ${{ needs.changes.outputs.docs == 'true' }}
  53. runs-on: ubuntu-latest
  54. steps:
  55. - name: Checkout 🛎️
  56. uses: actions/checkout@v2
  57. with:
  58. persist-credentials: false
  59. - name: Deploy docs 🚀
  60. uses: mhausenblas/mkdocs-deploy-gh-pages@master
  61. env:
  62. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  63. GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
  64. CONFIG_FILE: docs/mkdocs.yml