.gitlab-ci.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. variables:
  42. APT_CACHE_DIR: apt-cache
  43. script:
  44. - mkdir -pv $APT_CACHE_DIR && apt-get -qq update
  45. - apt install firefox-esr -y --no-install-recommends
  46. - firefox --version
  47. - yarn
  48. - yarn unit
  49. build:
  50. stage: build
  51. script:
  52. - yarn
  53. - npm run build
  54. artifacts:
  55. paths:
  56. - dist/
  57. docs-deploy:
  58. stage: deploy
  59. image: alpine:latest
  60. only:
  61. - develop@pleroma/pleroma-fe
  62. before_script:
  63. - apk add curl
  64. script:
  65. - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline