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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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: deploy static files
  31. image: node:12
  32. commands:
  33. - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
  34. - git config --global user.name "${DRONE_COMMIT_AUTHOR}"
  35. - git clone https://gitea.frontblock.me/fb-dist/${DRONE_REPO_NAME}.git
  36. - cp -r ./dist/* ./${DRONE_REPO_NAME}
  37. - cd ./${DRONE_REPO_NAME}
  38. - git add -A
  39. - git commit --allow-empty -m "drone taged as version ${DRONE_TAG}"
  40. - git tag ${DRONE_TAG}
  41. - git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fb-dist/${DRONE_REPO_NAME}.git master ${DRONE_TAG}
  42. environment:
  43. GIT_USER:
  44. from_secret: git_user
  45. GIT_PASSWORD:
  46. from_secret: git_password
  47. when:
  48. event:
  49. - tag
  50. volumes:
  51. - name: cache
  52. host:
  53. path: /tmp