Files
openstapps/.gitlab-ci.yml
Karl-Philipp Wulfert 626d87639f ci: add automatic publishing
Fixes #21
2019-05-27 18:07:31 +02:00

82 lines
1.1 KiB
YAML

image: registry.gitlab.com/openstapps/projectmanagement/node
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
before_script:
- npm install
stages:
- build
- test
- deploy
build:
stage: build
script:
- npm run build
artifacts:
paths:
- lib
test:
tags:
- docker
stage: test
script:
- npm test
audit:
stage: test
script:
- npm audit
allow_failure: true
except:
- schedules
scheduled-audit:
stage: test
script:
- npm audit
only:
- schedules
routes:
dependencies:
- build
stage: test
script:
- npm install @openstapps/core
- node lib/cli.js routes node_modules/@openstapps/core/lib routes.md
artifacts:
paths:
- routes.md
package:
dependencies:
- build
tags:
- secrecy
stage: deploy
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
- npm publish
only:
- /^v[0-9]+.[0-9]+.[0-9]+$/
artifacts:
paths:
- lib
pages:
stage: deploy
script:
- npm run documentation
- mv docs public
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
artifacts:
paths:
- public