Skip to content
This repository has been archived by the owner on Sep 5, 2018. It is now read-only.

auto deploy dist files to gh-pages/dist (testing) #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ coverage
# build
docs

tests/samples/files/partials/SJST/
tests/samples/files/partials/SJST/
26 changes: 18 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@ notifications:
- [email protected]
on_success: change
on_failure: always
env:
global:
- GH_REF: github.com/yahoo/secure-handlebars.git
- secure: IMKSQkQZnZVVtPKwzwt3n5RE4JUcHcY/ySKrQXCDA+Drzll6q31fJns+lN9xGfWMwWfv12+PXPvM+WU1o5IjuvfKOSxfLqy8xl1XxH3sJZuK4R1CI9SHToydJJu5V9zZeO40AvD+5G3Z5u6hOqrf2lbiaqq3zVz8DtEKxSg3OcE=
after_success:
- test $(cat $TRAVIS_BUILD_DIR/package.json | grep version | awk '{print $2}' | sed 's/"//g' | sed 's/,//g' | awk '{print "v"$1}' ) = $TRAVIS_TAG && test $(echo $TRAVIS_NODE_VERSION | awk '{print $1}' ) = '0.12' && export VALID_VERSION=true
deploy:
provider: npm
email: [email protected]
api_key:
secure: TNDHDZslbeI3CKi50Pe6wR6ZN+iAGsfaZ3+mFP/2w761bQV0Yc2Dbt2mP57sV8OHhP3XeKG7F3WXVLks9gu/pre6QObBQQEZlv7ojJKbvU+MYgedMw5VuehPT5Q8bz8mngkYvckL7uLegXiqTbPhsohfK00/xGzla0/RePeklpM=
on:
condition: $VALID_VERSION = true
tags: true
branch: master
- provider: npm
email: [email protected]
api_key:
secure: TNDHDZslbeI3CKi50Pe6wR6ZN+iAGsfaZ3+mFP/2w761bQV0Yc2Dbt2mP57sV8OHhP3XeKG7F3WXVLks9gu/pre6QObBQQEZlv7ojJKbvU+MYgedMw5VuehPT5Q8bz8mngkYvckL7uLegXiqTbPhsohfK00/xGzla0/RePeklpM=
on:
condition: $VALID_VERSION = true
tags: true
branch: master
- provider: script
script: ./bin/auto-push-gh-pages.sh
on:
condition: $VALID_VERSION = true
tags: true
branch: master
18 changes: 18 additions & 0 deletions bin/auto-push-gh-pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Assumption: all files are readily built and located at dist/

git clone "https://${GH_REF}" -b gh-pages gh-pages

# copy all files from dist to gh-pages/dist
mkdir gh-pages/dist
cp dist/* gh-pages/dist/

# set username as gh-pages-robot
cd gh-pages
git config --local user.name "gh-pages-robot"
git config --local user.email "[email protected]"

git add dist/.
git commit -m "Deploy latest dist files to gh-pages"

git push --quiet "https://${GH_TOKEN}@${GH_REF}" > /dev/null 2>&1