yudao-ui-admin.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: yudao-ui-admin CI
  2. # 在master分支发生push事件时触发。
  3. on:
  4. push:
  5. branches: [ master ]
  6. # pull_request:
  7. # branches: [ master ]
  8. env: # 设置环境变量
  9. TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间)
  10. WORK_DIR: yudao-ui-admin #工作目录
  11. defaults:
  12. run:
  13. shell: bash
  14. working-directory: yudao-ui-admin
  15. jobs:
  16. build: # 自定义名称
  17. runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest
  18. strategy:
  19. matrix:
  20. node_version: [14.x, 16.x]
  21. # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
  22. steps:
  23. - name: Checkout # 步骤1
  24. uses: actions/checkout@v2 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
  25. - name: Install pnpm
  26. uses: pnpm/action-setup@v2.0.1
  27. with:
  28. version: 6.15.1
  29. - name: Set node version to ${{ matrix.node_version }}
  30. uses: actions/setup-node@v2
  31. with:
  32. node-version: ${{ matrix.node_version }}
  33. cache: "yarn"
  34. cache-dependency-path: yudao-ui-admin/yarn.lock
  35. - name: Install deps
  36. run: node --version && yarn --version && yarn install
  37. - name: Build
  38. run: yarn build:prod
  39. # 查看 workflow 的文档来获取更多信息
  40. # @see https://github.com/crazy-max/ghaction-github-pages