You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. kind: pipeline
  2. type: docker
  3. name: default
  4. steps:
  5. - name: restore cache
  6. image: drillster/drone-volume-cache
  7. settings:
  8. restore: true
  9. mount:
  10. - ./node_modules
  11. volumes:
  12. - name: cache
  13. path: /cache
  14. - name: npm install
  15. image: node:12
  16. commands:
  17. - npm install
  18. - name: npm run build
  19. image: node:12
  20. commands:
  21. - npm run build
  22. - name: rebuild cache
  23. image: drillster/drone-volume-cache
  24. settings:
  25. rebuild: true
  26. mount:
  27. - ./node_modules
  28. volumes:
  29. - name: cache
  30. path: /cache
  31. - name: npm run test
  32. image: node:12
  33. commands:
  34. - npm run test
  35. - name: rebuild documentation
  36. image: node:12
  37. commands:
  38. - rm -rf docs
  39. - npm run docs
  40. when:
  41. event:
  42. - tag
  43. - name: npm publish
  44. image: plugins/npm
  45. settings:
  46. username: frontwork
  47. password:
  48. from_secret: npm_password
  49. email: frontwork.me@gmail.com
  50. when:
  51. event:
  52. - tag
  53. - name: deploy documentation
  54. image: node:12
  55. commands:
  56. - echo ${DRONE_BUILD_CREATED}
  57. - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
  58. - git config --global user.name "${DRONE_COMMIT_AUTHOR}"
  59. - echo "clone ${DRONE_REPO_NAME}"; git clone https://www.versioncontrol.me/frontwork-documentation/${DRONE_REPO_NAME}.git
  60. - cd ${DRONE_REPO_NAME}
  61. - git reset HEAD --hard
  62. - echo "remove files in ${DRONE_REPO_NAME}"; rm -rf ./*
  63. - echo "copy docs to ${DRONE_REPO_NAME}"; cp -r ../docs/* .
  64. - ls
  65. - rm ./README.md
  66. - head -n -2 ../README.md > ./README.md
  67. - echo "## Version" >> ./README.md
  68. - echo "${DRONE_TAG}" >> ./README.md
  69. - echo "" >> ./README.md
  70. - sed -i -e 1,4d ./globals.md
  71. - cat globals.md >> ./README.md
  72. - echo "add files in ${DRONE_REPO_NAME}"; git add -A
  73. - git commit --allow-empty -m "Drone tagged as ${DRONE_TAG}"
  74. - git push --force origin master
  75. environment:
  76. GIT_USER:
  77. from_secret: git_user
  78. GIT_PASSWORD:
  79. from_secret: git_password
  80. when:
  81. event:
  82. - tag
  83. volumes:
  84. - name: cache
  85. host:
  86. path: /tmp