image: node

stages:
  - build
  - deploy

build:
  stage: build
  script:
    - npm ci
    - npm run lint
    - npm run build
  only:
    - tags
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
    - node_modules/
  artifacts:
    paths:
      - public/
      - lambda/

deploy:
  stage: deploy
  environment:
    name: production
    url: https://iiro.fi
  before_script:
    - npm i -g netlify-cli@next
  script:
    - netlify deploy -d public -f lambda --prod -m $CI_COMMIT_TAG
  only:
    - tags

image: node

stages:
  - build
  - deploy

build:
  stage: build
  script:
    - npm ci
    - npm run lint
    - npm run build
  only:
    - tags
  cache:
    key: node_modules
    paths:
    - node_modules/
  artifacts:
    paths:
      - public/
      - lambda/

deploy:
  stage: deploy
  environment:
    name: production
    url: https://iiro.fi
  before_script:
    - npm i -g netlify-cli@next
  script:
    - netlify deploy -d public -f lambda --prod -m $CI_COMMIT_TAG
  only:
    - tags

Use generic cache key for node_modules
ci: Use generic cache key for node_modules
