26 lines
799 B
YAML
26 lines
799 B
YAML
dist: trusty
|
|
sudo: true
|
|
|
|
install:
|
|
- wget -q https://github.com/gohugoio/hugo/releases/download/v0.31.1/hugo_0.31.1_Linux-64bit.deb -O hugo.deb
|
|
- sudo dpkg -i hugo.deb
|
|
|
|
script:
|
|
- hugo
|
|
|
|
after_success: |
|
|
set -e
|
|
if [ -n "$GITHUB_TOKEN" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
|
|
cd "$TRAVIS_BUILD_DIR"
|
|
cd public
|
|
git init
|
|
git checkout -b master
|
|
git add .
|
|
git -c user.name='cwpearson' -c user.email='carl.w.pearson@gmail.com' commit -m "push from hugo-cwpearson $TRAVIS_COMMIT"
|
|
# Make sure to make the output quiet, or else the API token will leak!
|
|
# This works because the API key can replace your password.
|
|
git push -f -q https://cwpearson:$GITHUB_TOKEN@github.com/cwpearson/cwpearson.github.io master 2> /dev/null
|
|
cd "$TRAVIS_BUILD_DIR"
|
|
fi
|
|
set +e
|