.drone.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. kind: pipeline
  2. type: docker
  3. name: default
  4. steps:
  5. - name: install-node
  6. image: node:16.10.0
  7. commands:
  8. - npm config set registry https://registry.npmmirror.com
  9. - yarn config set registry https://registry.npmmirror.com
  10. - yarn
  11. - yarn build:test
  12. - name: zip-dist
  13. image: alpine:3.12
  14. commands:
  15. - apk add zip
  16. - zip -r dist.zip dist
  17. - name: push
  18. image: appleboy/drone-scp
  19. settings:
  20. host:
  21. from_secret: TestServerIP
  22. port:
  23. from_secret: Port
  24. username: root
  25. password:
  26. from_secret: TestServerPwd
  27. command_timeout: 3m
  28. target: /opt/docker/other/nginx/html/
  29. source:
  30. - dist.zip
  31. status:
  32. - success
  33. - name: deploy
  34. image: appleboy/drone-ssh
  35. settings:
  36. host:
  37. from_secret: TestServerIP
  38. username: root
  39. password:
  40. from_secret: TestServerPwd
  41. port:
  42. from_secret: Port
  43. script:
  44. - 'cd /opt/docker/other/nginx/html'
  45. - 'unzip dist.zip'
  46. - 'rm -rf dist.zip'
  47. - 'rm -f admin'
  48. - 'mv dist admin'
  49. - 'docker exec nginx nginx -s reload'
  50. status:
  51. - success
  52. trigger:
  53. branch:
  54. - 2.0
  55. event:
  56. - push