Skip to content
Snippets Groups Projects
.gitlab-ci.yml 6.29 KiB
variables:
  DOCKER_TLS_CERTDIR: "" # HACK: see https://gitlab.com/gitlab-org/gitlab-runner/issues/4501

stages:
  - setup
  - check
  - build
  - deploy

# TODO: maybe stup some notifications as a last stage?

#==[ JOB TEMPLATES ]============================================================

.node-job: &node-job
  image: node:16-alpine
  # tags:
  #   - shared
  only:
    - pushes

.fe-node-job:
  <<: *node-job
  cache:
    key:
      files:
        - frontend/package-lock.json
    paths:
      - frontend/.npm/
  before_script:
    - cd frontend
    - npm ci --cache .npm --prefer-offline

.be-node-job:
  <<: *node-job
  cache:
    key:
      files:
        - backend/package-lock.json
    paths:
      - backend/.npm/
  before_script:
    - cd backend
    - npm ci --cache .npm --prefer-offline

#==[ SETUP STAGE ]==============================================================

#--[ Frontend ]-----------------------------------------------------------------

cache-fe-node-job:
  extends: .fe-node-job
  stage: setup
  script:
    - echo "Done!"

#--[ Backend ]------------------------------------------------------------------

cache-be-node-job:
  extends: .be-node-job
  stage: setup
  script:
    - echo "Done!"

#==[ CHECK STAGE ]==============================================================

#--[ Frontend ]-----------------------------------------------------------------

.check-fe-node-job: &check-fe-node-job
  extends: .fe-node-job
  stage: check
  needs: