.gitlab-ci.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # This file is a template, and might need editing before it works on your project.
  2. # Official framework image. Look for the different tagged releases at:
  3. # https://hub.docker.com/r/library/node/tags/
  4. image: node:16
  5. stages:
  6. - check-changelog
  7. - lint
  8. - build
  9. - test
  10. - deploy
  11. # https://git.pleroma.social/help/ci/yaml/workflow.md#switch-between-branch-pipelines-and-merge-request-pipelines
  12. workflow:
  13. rules:
  14. - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  15. - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
  16. when: never
  17. - if: $CI_COMMIT_BRANCH
  18. check-changelog:
  19. stage: check-changelog
  20. image: alpine
  21. rules:
  22. - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^renovate/
  23. when: never
  24. - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'weblate'
  25. when: never
  26. - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
  27. before_script: ''
  28. after_script: ''
  29. cache: {}
  30. script:
  31. - apk add git
  32. - sh ./tools/check-changelog
  33. lint:
  34. stage: lint
  35. script:
  36. - yarn
  37. - npm run lint
  38. - npm run stylelint
  39. test:
  40. stage: test
  41. tags:
  42. - amd64
  43. variables:
  44. APT_CACHE_DIR: apt-cache
  45. script:
  46. - mkdir -pv $APT_CACHE_DIR && apt-get -qq update
  47. - apt install firefox-esr -y --no-install-recommends
  48. - firefox --version
  49. - yarn
  50. - yarn unit
  51. build:
  52. stage: build
  53. tags:
  54. - amd64
  55. script:
  56. - yarn
  57. - npm run build
  58. artifacts:
  59. paths:
  60. - dist/
  61. docs-deploy:
  62. stage: deploy
  63. image: alpine:latest
  64. only:
  65. - develop@pleroma/pleroma-fe
  66. before_script:
  67. - apk add curl
  68. script:
  69. - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline