ts-osc/.gitlab-ci.yml
2021-01-29 20:44:31 +01:00

60 lines
929 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
artifacts:
expire_in: 1 hour
paths:
- lib
pages:
stage: deploy
allow_failure: true
script:
- mkdir .public
- cp -r ./docs/* .public
- mv .public public
artifacts:
paths:
- public
npm_publish:
stage: deploy
allow_failure: true
only:
- master
script:
- npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
- npm publish
dependencies:
- build
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