.gitlab-ci.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. build_admin:
  62. stage: build
  63. tags:
  64. - amd64
  65. variables:
  66. ADMINFE_BUILD: yes
  67. script:
  68. - yarn
  69. - npm run build
  70. artifacts:
  71. paths:
  72. - dist/
  73. docs-deploy:
  74. stage: deploy
  75. image: alpine:latest
  76. only:
  77. - develop@pleroma/pleroma-fe
  78. before_script:
  79. - apk add curl
  80. script:
  81. - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline