.drone.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. ---
  2. kind: pipeline
  3. name: archives
  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. - git diff --name-only HEAD^ HEAD | grep package-lock.json && pnpm install --no-frozen-lockfile
  25. - "[ -d node_modules ] && echo 'deps install done' || pnpm install --no-frozen-lockfile"
  26. - pnpm run build:dev
  27. when:
  28. branch:
  29. - dev
  30. - name: build-prod
  31. image: docker.1ms.run/node:16.14.2
  32. commands:
  33. - node --version
  34. - npm install pnpm@8.15.4 -g --registry https://registry.npmmirror.com/
  35. - pnpm --version
  36. - pnpm install --no-frozen-lockfile --registry https://registry.npmmirror.com/
  37. - git diff --name-only HEAD^ HEAD | grep package-lock.json && pnpm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile
  38. - "[ -d node_modules ] && echo 'deps install done' || pnpm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile"
  39. - pnpm run build
  40. when:
  41. branch:
  42. - master
  43. - name: build-cqmz
  44. image: docker.1ms.run/node:16.14.2
  45. commands:
  46. - node --version
  47. - npm install pnpm@8.15.4 -g --registry https://registry.npmmirror.com/
  48. - pnpm --version
  49. - pnpm install --no-frozen-lockfile --registry https://registry.npmmirror.com/
  50. - git diff --name-only HEAD^ HEAD | grep package-lock.json && pnpm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile
  51. - "[ -d node_modules ] && echo 'deps install done' || pnpm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile"
  52. - pnpm run build:cqmz
  53. - name: rebuild-cache
  54. image: docker.1ms.run/drillster/drone-volume-cache
  55. settings:
  56. rebuild: true
  57. cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME]
  58. mount:
  59. - ./node_modules
  60. volumes:
  61. - name: cache
  62. path: /cache
  63. - name: deploy-dev
  64. image: docker.1ms.run/drillster/drone-rsync
  65. settings:
  66. user: root
  67. port: 22
  68. hosts: [api.mdfitnesscao.com]
  69. source: ./dist/*
  70. target: /docker/www/platform_agency
  71. include: []
  72. exclude: []
  73. key:
  74. from_secret: ssh_key
  75. when:
  76. branch:
  77. - dev
  78. - name: deploy-prod
  79. image: docker.1ms.run/drillster/drone-rsync
  80. settings:
  81. user: root
  82. port: 22
  83. hosts: [api.hhmdtech.com]
  84. source: ./dist/*
  85. target: /docker/www/platform_agency
  86. include: []
  87. exclude: []
  88. key:
  89. from_secret: ssh_key
  90. when:
  91. branch:
  92. - master
  93. volumes:
  94. - name: cache
  95. host:
  96. path: /tmp
  97. trigger:
  98. branch:
  99. - dev
  100. - master