Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

.drone.yml 1.9KB

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