aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: d6ba7f9a233ede877790c506e29049af94a3d838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:16

stages:
  - check-changelog
  - lint
  - build
  - test
  - deploy

check-changelog:
  stage: check-changelog
  image: alpine
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^renovate/
      when: never
    - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'weblate'
      when: never
    - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
  before_script: ''
  after_script: ''
  cache: {}
  script:
    - apk add git
    - sh ./tools/check-changelog

lint:
  stage: lint
  script:
    - yarn
    - npm run lint
    - npm run stylelint

test:
  stage: test
  variables:
    APT_CACHE_DIR: apt-cache
  script:
    - mkdir -pv $APT_CACHE_DIR && apt-get -qq update
    - apt install firefox-esr -y --no-install-recommends
    - firefox --version
    - yarn
    - yarn unit

build:
  stage: build
  script:
    - yarn
    - npm run build
  artifacts:
    paths:
    - dist/

docs-deploy:
  stage: deploy
  image: alpine:latest
  only:
  - develop@pleroma/pleroma-fe
  before_script:
  - apk add curl
  script:
  - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline