NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

.drone.yml 1.7KB

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