.drone.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ---
  2. kind: pipeline
  3. name: distributor-h5
  4. concurrency:
  5. limit: 1
  6. steps:
  7. - name: restore-cache
  8. image: docker.1ms.run/drillster/drone-volume-cache
  9. settings:
  10. restore: true
  11. cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME]
  12. mount:
  13. - ./node_modules
  14. volumes:
  15. - name: cache
  16. path: /cache
  17. - name: build-dev
  18. image: docker.1ms.run/node:16.14.2
  19. commands:
  20. - node --version
  21. - npm install pnpm@8.15.4 -g --registry https://registry.npmmirror.com/
  22. - pnpm --version
  23. - pnpm install --no-frozen-lockfile --registry https://registry.npmmirror.com/
  24. # - pnpm install --no-frozen-lockfile --registry https://registry.npmmirror.com/
  25. - git diff --name-only HEAD^ HEAD | grep package-lock.json && pnpm install --no-frozen-lockfile
  26. - "[ -d node_modules ] && echo 'deps install done' || pnpm install --no-frozen-lockfile"
  27. - pnpm run build:dev
  28. when:
  29. branch:
  30. - dev
  31. - name: build-prod
  32. image: docker.1ms.run/node:16.14.2
  33. commands:
  34. - node --version
  35. - npm install pnpm@8.15.4 -g --registry https://registry.npmmirror.com/
  36. - pnpm --version
  37. - pnpm install --no-frozen-lockfile --registry https://registry.npmmirror.com/
  38. - git diff --name-only HEAD^ HEAD | grep package-lock.json && pnpm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile
  39. - "[ -d node_modules ] && echo 'deps install done' || pnpm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile"
  40. - pnpm run build
  41. when:
  42. branch:
  43. - master
  44. - name: rebuild-cache
  45. image: docker.1ms.run/drillster/drone-volume-cache
  46. settings:
  47. rebuild: true
  48. cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME]
  49. mount:
  50. - ./node_modules
  51. volumes:
  52. - name: cache
  53. path: /cache
  54. - name: deploy-dev
  55. image: docker.1ms.run/drillster/drone-rsync
  56. settings:
  57. user: root
  58. port: 22
  59. hosts: [cps.mdfitnesscao.com]
  60. source: ./dist/*
  61. target: /docker/www/cps
  62. include: []
  63. exclude: []
  64. key:
  65. from_secret: ssh_key
  66. when:
  67. branch:
  68. - dev
  69. - name: deploy-prod
  70. image: docker.1ms.run/drillster/drone-rsync
  71. settings:
  72. user: root
  73. port: 22
  74. hosts: [cps.hhmdtech.com]
  75. source: ./dist/*
  76. target: /docker/www/cps
  77. include: []
  78. exclude: []
  79. key:
  80. from_secret: ssh_key
  81. when:
  82. branch:
  83. - master
  84. volumes:
  85. - name: cache
  86. host:
  87. path: /tmp
  88. trigger:
  89. branch:
  90. - dev
  91. - master