.gitlab-ci.yml 1.8 KB

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