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 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. branch:
  61. - master
  62. steps:
  63. # post-receive hook
  64. - name: push commit
  65. image: appleboy/drone-git-push:0.2.0-linux-amd64
  66. settings:
  67. branch: master
  68. remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
  69. remote_name: staging
  70. force: true
  71. ssh_key:
  72. # !: id_rsa from DRONE machine
  73. from_secret: push_deploy_key
  74. volumes:
  75. - name: node_cache
  76. host:
  77. path: /tmp/cache/drone/node_modules
  78. - name: build
  79. host:
  80. path: /tmp/cache/drone/build