.drone.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ---
  2. kind: pipeline
  3. name: thirdLargeScreen
  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: rebuild-cache
  44. image: docker.1ms.run/drillster/drone-volume-cache
  45. settings:
  46. rebuild: true
  47. cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME]
  48. mount:
  49. - ./node_modules
  50. volumes:
  51. - name: cache
  52. path: /cache
  53. - name: deploy-dev
  54. image: docker.1ms.run/drillster/drone-rsync
  55. settings:
  56. user: root
  57. port: 22
  58. hosts: [api.mdfitnesscao.com]
  59. source: ./dist/*
  60. target: /docker/www/agency
  61. include: []
  62. exclude: []
  63. key:
  64. from_secret: ssh_key
  65. when:
  66. branch:
  67. - dev
  68. - name: deploy-prod
  69. image: docker.1ms.run/drillster/drone-rsync
  70. settings:
  71. user: root
  72. port: 22
  73. hosts: [api.hhmdtech.com]
  74. source: ./dist/*
  75. target: /docker/www/agency
  76. include: []
  77. exclude: []
  78. key:
  79. from_secret: ssh_key
  80. when:
  81. branch:
  82. - master
  83. volumes:
  84. - name: cache
  85. host:
  86. path: /tmp
  87. trigger:
  88. branch:
  89. - dev
  90. - master