NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

.drone.yml 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. - npx browserslist@latest --update-db
  30. - npm run build
  31. - ls ./build
  32. environment:
  33. NODE_OPTIONS: --openssl-legacy-provider
  34. volumes:
  35. # Link node_modules cache from host filesystem into container at the expected location
  36. - name: node_cache
  37. path: /drone/src/vue-theme/node_modules
  38. - name: build
  39. path: /drone/src/vue-theme/build
  40. volumes:
  41. - name: node_cache
  42. host:
  43. path: /tmp/cache/drone/node_modules
  44. - name: build
  45. host:
  46. path: /tmp/cache/drone/build
  47. ---
  48. ########################
  49. # Deploy to Production #
  50. ########################
  51. kind: pipeline
  52. name: deploy
  53. depends_on:
  54. # Must run after the first pipeline
  55. - run_tests
  56. trigger:
  57. status:
  58. # Only runs if the first pipeline was fully successful
  59. - success
  60. # Only runs on the master branch
  61. branch:
  62. - master
  63. steps:
  64. # post-receive hook
  65. - name: push commit
  66. image: appleboy/drone-git-push:0.2.0-linux-amd64
  67. settings:
  68. branch: master
  69. remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
  70. remote_name: staging
  71. force: true
  72. ssh_key:
  73. # !: id_rsa from DRONE machine
  74. from_secret: push_deploy_key
  75. volumes:
  76. - name: node_cache
  77. host:
  78. path: /tmp/cache/drone/node_modules
  79. - name: build
  80. host:
  81. path: /tmp/cache/drone/build