.drone.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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
  10. - yarn build:test
  11. - name: zip-dist
  12. image: alpine:3.12
  13. commands:
  14. - apk add zip
  15. - zip -r dist.zip dist
  16. - name: push
  17. image: appleboy/drone-scp
  18. settings:
  19. host:
  20. from_secret: TestServerIP
  21. port:
  22. from_secret: Port
  23. username: root
  24. password:
  25. from_secret: TestServerPwd
  26. command_timeout: 3m
  27. target: /opt/docker/other/nginx/html/
  28. source:
  29. - dist.zip
  30. status:
  31. - success
  32. - name: deploy
  33. image: appleboy/drone-ssh
  34. settings:
  35. host:
  36. from_secret: TestServerIP
  37. username: root
  38. password:
  39. from_secret: TestServerPwd
  40. port:
  41. from_secret: Port
  42. script:
  43. - 'cd /opt/docker/other/nginx/html'
  44. - 'unzip dist.zip'
  45. - 'rm -rf dist.zip'
  46. - 'rm -f admin'
  47. - 'mv dist admin'
  48. - 'docker exec nginx nginx -s reload'
  49. status:
  50. - success
  51. trigger:
  52. branch:
  53. - 2.0
  54. event:
  55. - push