.gitlab-ci.yml 909 Bytes
Newer Older
1 2 3
include:
  - local: 'prezbuilder-ci.yml'

4
default:
5 6 7 8
  retry: 2
  interruptible: true

stages:
9
  - test
10
  - build
11 12
  - deploy

13 14 15
lint:
  stage: test
  tags: [docker]
16
  image: node:12-buster
Guillaume Perréal's avatar
Guillaume Perréal committed
17 18
  variables:
    NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.npm"
19
  script:
20
    - npm install
21
    - npm run lint
Guillaume Perréal's avatar
Guillaume Perréal committed
22
  cache:
23
    key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
Guillaume Perréal's avatar
Guillaume Perréal committed
24 25
    paths:
      - "$NPM_CONFIG_CACHE"
26

27
docker-image:
28 29 30
  stage: build
  tags: [dind]
  variables:
31 32 33
    IMAGE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
    PREZBUILDER_IMAGE: "${CI_REGISTRY_IMAGE}"
    PREZBUILDER_TAG: "${CI_COMMIT_REF_NAME}"
34
  script:
35 36
    - docker build --tag "${IMAGE}" .
    - bin/prezbuilder-docker build src public
37
    - "[ -e public/index.html ]"
38
    - docker push "${IMAGE}"
39

40
pages:
41 42 43
  extends: .prezbuilder
  variables:
    PREZBUILDER_IMAGE: "$CI_REGISTRY_IMAGE"
44
    PREZBUILDER_TAG: "$CI_COMMIT_REF_NAME"
Guillaume Perréal's avatar
Guillaume Perréal committed
45
  rules:
46
    - if: $CI_COMMIT_TAG