ts-osc/.gitlab-ci.yml
2021-01-23 20:51:13 +01:00

54 lines
839 B
YAML

image: node:12.13
cache:
paths:
- lib/
- docs/
stages:
- lint
- build
- deploy
- clean
lint:
stage: lint
before_script:
- npm install
script:
- npm run lint
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