config.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. version: 2.1
  2. orbs:
  3. node: circleci/node@1.1.6
  4. cypress: cypress-io/cypress@1.25.0
  5. jobs:
  6. lint-and-build:
  7. executor:
  8. name: node/default
  9. environment:
  10. NETLIFY_SITE_ID: airboardgame.netlify.app
  11. REACT_APP_SOCKET_URL: https://public.jeremiez.net/
  12. REACT_APP_SOCKET_PATH: /wamp2/socket.io
  13. REACT_APP_GAMELIST_URL: https://airgames.netlify.app/gameList.json
  14. REACT_APP_API_ENDPOINT: https://public.jeremiez.net/ricochet
  15. CYPRESS_INSTALL_BINARY: 0
  16. steps:
  17. - checkout
  18. - node/with-cache:
  19. steps:
  20. - run: node --version
  21. - run: npm install
  22. - run: npm run lint
  23. - run: cd backend && npm install && npm run build
  24. - run: npm run build
  25. - run:
  26. name: Netlify Deploy
  27. command: npx netlify deploy --dir=./build --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN
  28. build-deploy:
  29. executor:
  30. name: node/default
  31. environment:
  32. NETLIFY_SITE_ID: airboardgame.netlify.app
  33. REACT_APP_SOCKET_URL: https://public.jeremiez.net/
  34. REACT_APP_SOCKET_PATH: /wamp2/socket.io
  35. REACT_APP_GAMELIST_URL: https://airgames.netlify.app/gameList.json
  36. REACT_APP_API_ENDPOINT: https://public.jeremiez.net/ricochet
  37. steps:
  38. - checkout
  39. - node/with-cache:
  40. steps:
  41. - run: npm install
  42. - run: npm run lint
  43. - run: cd backend && npm install && npm run build
  44. - run: npm run build
  45. - run:
  46. name: Netlify Deploy
  47. command: npx netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN --dir=build --prod
  48. workflows:
  49. e2etest:
  50. jobs:
  51. - cypress/run:
  52. start: REACT_APP_NO_WELCOME=1 REACT_APP_SOCKET_URL=https://public.jeremiez.net/ REACT_APP_SOCKET_PATH=/wamp2/socket.io REACT_APP_API_ENDPOINT=https://public.jeremiez.net/ricochet CI=true npm start
  53. wait-on: "http-get://localhost:3000"
  54. no-workspace: true
  55. store_artifacts: true
  56. build-and-test:
  57. jobs:
  58. - lint-and-build:
  59. filters:
  60. branches:
  61. ignore:
  62. - master
  63. - build-deploy:
  64. filters:
  65. branches:
  66. only:
  67. - master