.gitlab-ci.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. image: node:latest
  2. stages:
  3. - build
  4. - test
  5. - deploy
  6. cache:
  7. paths:
  8. - node_modules/
  9. install_dependencies:
  10. stage: build
  11. script:
  12. - npm install -g gulp nyc parcel-bundler@^1.12.4
  13. - npm install
  14. artifacts:
  15. paths:
  16. - node_modules/
  17. testing:
  18. stage: test
  19. script:
  20. - npx nyc gulp test
  21. - npx nyc report --reporter=html
  22. - npx rimraf public && npx parcel build ./src/index.pug --no-content-hash --no-minify -d ./public --public-url ./ --no-cache && node parcel-postbuild.js
  23. artifacts:
  24. paths:
  25. - public
  26. - coverage
  27. - .nyc_output
  28. merge_test:
  29. stage: test
  30. script:
  31. - npx nyc gulp test
  32. - npx nyc report --reporter=html
  33. - npx rimraf public && npx parcel build ./src/index.pug --no-content-hash --no-minify -d ./public --public-url ./ --no-cache && node parcel-postbuild.js
  34. artifacts:
  35. only:
  36. - merge_requests
  37. pages:
  38. stage: deploy
  39. script:
  40. - mkdir .public
  41. - cp -r * .public
  42. - mv .public public
  43. - mv coverage/ public/coverage/
  44. artifacts:
  45. paths:
  46. - public
  47. only:
  48. - master