image: node:12.13 cache: paths: - lib/ - docs/ stages: - build - deploy - clean build: stage: build only: - master script: - npm install - npm run build pages: stage: deploy allow_failure: true script: - mkdir .public - cp -r ./docs/* .public - mv .public public artifacts: paths: - public publish: stage: deploy allow_failure: true only: - master script: - npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - npm publish clean: when: always stage: clean script: - docker rm -v $(docker container ls -q --all --filter=name="runner-*" --filter=status=exited) || true - docker rmi $(docker images -f"dangling=true" -q) || true