Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

.drone.yml 1.9KB

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