Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.71 KiB
default:
  image: node:12

stages:
  - fetch
  - deps
  - check
  - build
  - test
  - deploy

submodule_fetch:
  stage: fetch
  script:
    - chmod 600 .drawing-app-deploy.rsa
    - git submodule sync --recursive
    - GIT_SSH_COMMAND='ssh -i .drawing-app-deploy.rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git submodule update --init
  artifacts:
    paths:
      - src/liowebrtc
      - src/rtcpeerconnection
      - src/signalbuddy
      - src/yjs

node_install:
  stage: deps
  dependencies:
    - submodule_fetch
  script:
    - npm ci --only=prod
  artifacts:
    paths:
      - node_modules
      - src/liowebrtc
      - src/rtcpeerconnection
      - src/signalbuddy
      - src/yjs

dev_node_install:
  stage: deps
  dependencies:
    - submodule_fetch
  script:
    - npm ci
  artifacts:
    paths:
      - node_modules
      - src/liowebrtc
      - src/rtcpeerconnection
      - src/signalbuddy
      - src/yjs

check_format:
  stage: check
  dependencies:
    - dev_node_install
  script:
    - npx prettier --ignore-path .gitignore --check "**/*.{html,js,json,md}"

lint:
  stage: check
  dependencies:
    - dev_node_install
  script:
    - npx eslint --ignore-path .gitignore "**/*.js"

backend_build:
  stage: build
  dependencies:
    - dev_node_install