NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
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.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ---
  2. ################
  3. # SECRETS #
  4. ################
  5. # push_deploy_key: id_rsa from DRONE host machine
  6. ################
  7. # Build & Test #
  8. ################
  9. kind: pipeline
  10. name: run_tests
  11. steps:
  12. # Test the vue theme
  13. - name: test
  14. image: node
  15. commands:
  16. - pwd
  17. - cd ./vue-theme
  18. - npm install
  19. - npm test
  20. volumes:
  21. # Link node_modules cache from host filesystem into container at the expected location
  22. - name: node_cache
  23. path: /drone/src/vue-theme/node_modules
  24. - name: build
  25. image: node
  26. commands:
  27. - cd ./vue-theme
  28. - rm -Rf ./build/*
  29. - npm run build
  30. - ls ./build
  31. volumes:
  32. # Link node_modules cache from host filesystem into container at the expected location
  33. - name: node_cache
  34. path: /drone/src/vue-theme/node_modules
  35. - name: build
  36. path: /drone/src/vue-theme/build
  37. volumes:
  38. - name: node_cache
  39. host:
  40. path: /tmp/cache/drone/node_modules
  41. - name: build
  42. host:
  43. path: /tmp/cache/drone/build
  44. ---
  45. ########################
  46. # Deploy to Production #
  47. ########################
  48. kind: pipeline
  49. name: deploy
  50. depends_on:
  51. # Must run after the first pipeline
  52. - run_tests
  53. trigger:
  54. status:
  55. # Only runs if the first pipeline was fully successful
  56. - success
  57. steps:
  58. # post-receive hook
  59. - name: push commit
  60. image: appleboy/drone-git-push:0.2.0-linux-amd64
  61. settings:
  62. branch: master
  63. remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
  64. remote_name: staging
  65. force: true
  66. ssh_key:
  67. # !: id_rsa from DRONE machine
  68. from_secret: push_deploy_key
  69. volumes:
  70. - name: node_cache
  71. host:
  72. path: /tmp/cache/drone/node_modules
  73. - name: build
  74. host:
  75. path: /tmp/cache/drone/build