NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

.drone.yml 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ---
  2. ################
  3. # SECRETS #
  4. ################
  5. # push_deploy_key: id_rsa from DRONE host machine
  6. ##############
  7. # Test Theme #
  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. volumes:
  25. - name: node_cache
  26. host:
  27. path: /tmp/cache/drone/node_modules
  28. - name: build
  29. host:
  30. path: /tmp/cache/drone/build
  31. ---
  32. #############
  33. # Run Build #
  34. #############
  35. kind: pipeline
  36. name: run_build
  37. depends_on:
  38. # Must run after the first pipeline
  39. - run_tests
  40. trigger:
  41. status:
  42. # Only runs if the first pipeline was fully successful
  43. - success
  44. # Only runs on the master branch
  45. branch:
  46. - dev
  47. steps:
  48. - name: build
  49. image: node
  50. commands:
  51. - cd ./vue-theme
  52. - rm -Rf ./build/*
  53. - npx browserslist@latest --update-db
  54. - npm run build
  55. - ls ./build
  56. environment:
  57. NODE_OPTIONS: --openssl-legacy-provider
  58. volumes:
  59. # Link node_modules cache from host filesystem into container at the expected location
  60. - name: node_cache
  61. path: /drone/src/vue-theme/node_modules
  62. - name: build
  63. path: /drone/src/vue-theme/build
  64. volumes:
  65. - name: node_cache
  66. host:
  67. path: /tmp/cache/drone/node_modules
  68. - name: build
  69. host:
  70. path: /tmp/cache/drone/build
  71. ---
  72. ########################
  73. # Deploy to Production #
  74. ########################
  75. kind: pipeline
  76. name: deploy
  77. depends_on:
  78. # Must run after the first pipeline
  79. - run_build
  80. trigger:
  81. status:
  82. # Only runs if the first pipeline was fully successful
  83. - success
  84. # Only runs on the master branch
  85. branch:
  86. - master
  87. steps:
  88. # post-receive hook
  89. - name: push commit
  90. image: appleboy/drone-git-push:0.2.0-linux-amd64
  91. settings:
  92. branch: master
  93. remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
  94. remote_name: staging
  95. force: true
  96. ssh_key:
  97. # !: id_rsa from DRONE machine
  98. from_secret: push_deploy_key
  99. volumes:
  100. - name: node_cache
  101. host:
  102. path: /tmp/cache/drone/node_modules
  103. - name: build
  104. host:
  105. path: /tmp/cache/drone/build