language: node_js node_js: - "10" stages: - audit - test - deploy jobs: include: - stage: audit if: tag IS blank name: "Test lint and audit" script: - npm run lint - audit-ci --moderate - stage: test if: type = pull_request name: "Run unit testing" services: - docker before_install: - docker-compose -f ./.test/docker-compose.yml up -d script: - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then npm test; fi' - stage: deploy if: tag IS present name: "Deploy to npm" script: - echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc - npm install - npm run build - ./script.sh