diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6a643e7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +sudo: false +language: node_js +node_js: + - "10.11.0" +env: + - CXX=g++-5 +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 +script: + - npm test + - npm build +branches: + only: + - gh-pages + - /.*/ +deploy: + - provider: script + skip_cleanup: true + script: bash .travis_publish + on: + tags: true + - provider: npm + email: "reto@factsmission.com" + api_key: $NPM_AUTH_TOKEN + on: + tags: true \ No newline at end of file diff --git a/.travis_publish b/.travis_publish new file mode 100644 index 0000000..47c81b6 --- /dev/null +++ b/.travis_publish @@ -0,0 +1,20 @@ +#!/bin/bash +# based on https://github.com/linkeddata/rdflib.js/blob/master/.travis_publish +PUBLICATION_BRANCH=gh-pages + +# Checkout the branch +REPO_PATH=$PWD +pushd $HOME +git clone --branch=$PUBLICATION_BRANCH https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git publish 2>&1 > /dev/null +cd publish + +# Update pages +cp -r $REPO_PATH/dist/* . + +# Commit and push latest version +git add . +git config user.name "Travis" +git config user.email "travis@travis-ci.org" +git commit -m "Updated distribution." +git push -fq origin $PUBLICATION_BRANCH 2>&1 > /dev/null +popd \ No newline at end of file