.gitlab-ci.yml 646 Bytes
Newer Older
1
default:
2
3
4
5
6
7
8
9
10
11
12
  tags: [docker]
  image: node:14
  retry: 2
  interruptible: true

stages:
  - test
  - deploy

lint:
  stage: test
Guillaume Perréal's avatar
Guillaume Perréal committed
13
14
  variables:
    NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.npm"
15
16
17
18
19
20
21
  before_script:
    - node --version
    - npm --version
    - npm install
  script:
    - npm run lint
  artifacts:
Guillaume Perréal's avatar
Guillaume Perréal committed
22
23
24
    name: node_modules
    expire_in: 1 day
    paths:
25
      - node_modules/
Guillaume Perréal's avatar
Guillaume Perréal committed
26
27
28
29
  cache:
    key: "$CI_COMMIT_REF_NAME-$CI_JOB_NAME"
    paths:
      - "$NPM_CONFIG_CACHE"
30
31
32

pages:
  stage: deploy
33
  needs: [lint]
Guillaume Perréal's avatar
Guillaume Perréal committed
34
35
  rules:
    - if: $CI_COMMIT_BRANCH == "master"
36
37
38
  script:
    - npm run build
  artifacts:
Guillaume Perréal's avatar
Guillaume Perréal committed
39
40
    name: pages
    paths:
41
      - public/