services:
  - name: docker:dind
    entrypoint: ["env", "-u", "DOCKER_HOST"]

stages:
  - test
  - deploy

default:
  image: node:14.15.1-alpine

# -------
#  JOBS
# -------

lint:
  stage: test
  image: node:lts-alpine
  tags:
    - aks-devops-shared
  script:
    - npm ci
    - npm run lint

publish:
  stage: deploy
  image: node:lts-alpine
  tags:
    - aks-devops-shared
  when: manual
  only:
    - tags
  script:
    - echo "//${NPM_REGISTRY_DOMAIN}/:_authToken=${NPM_AUTH_TOKEN}" >> .npmrc
    - npm publish --access public
