Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.73 KiB
image: node:16.14.2-slim

stages:
  - build
  - 🧪 test
  - 📝 publish
  - 🧽 clean

variables:
  SUB_GROUP:          "www"

.cache:
  tags:
    - cache
  cache:
    key:
      files:
        - package-lock.json
    paths:
      - node_modules/
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_MERGE_REQUEST_IID

.cache-push:
  extends: .cache
  cache:
    policy: push

.cache-pull:
  extends: .cache
  cache:
    policy: pull

install_dependencies:
  extends: .cache-push
  stage: build
  script:
    - npm ci
  rules:
    - changes:
        - package-lock.json

lint:
  extends: .cache-pull
  stage: 🧪 test
  script:
    - npm run lint

pages:
  extends: .cache-pull
  stage: 📝 publish
  script:
    - npm run build
    - mv build public
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  environment:
    name: production
    url: "${DOCUSAURUS_URL}"

pages:preview:
  extends: pages
  artifacts:
    expire_in: 2 week
  rules:
    - if: $CI_MERGE_REQUEST_IID