Skip to content

Commit

Permalink
configuring for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
retog committed Sep 30, 2019
1 parent 85543f4 commit e2eeaab
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
api_key: $NPM_AUTH_TOKEN
on:
tags: true
20 changes: 20 additions & 0 deletions .travis_publish
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
git commit -m "Updated distribution."
git push -fq origin $PUBLICATION_BRANCH 2>&1 > /dev/null
popd

0 comments on commit e2eeaab

Please sign in to comment.