travis: first pass

This commit is contained in:
Carl Pearson
2017-12-17 17:13:10 -06:00
parent 94023c5350
commit 839d255f1c

View File

@@ -1,15 +1,22 @@
dist: trusty
install:
- snap install hugo
script:
- hugo
after_success: | after_success: |
if [ -n "$GITHUB_API_KEY" ]; then if [ -n "$GITHUB_TOKEN" ]; then
cd "$TRAVIS_BUILD_DIR" cd "$TRAVIS_BUILD_DIR"
# This generates a `web` directory containing the website. # This generates a `web` directory containing the website.
make web cd public
cd web
git init git init
git checkout -b gh-pages git checkout -b master
git add . git add .
git -c user.name='travis' -c user.email='travis' commit -m init git -c user.name='cwpearson' -c user.email='carl.w.pearson@gmail.com' commit -m init
# Make sure to make the output quiet, or else the API token will leak! # Make sure to make the output quiet, or else the API token will leak!
# This works because the API key can replace your password. # This works because the API key can replace your password.
git push -f -q https://<me>:$GITHUB_API_KEY@github.com/<me>/<myrepo>-gh-pages gh-pages &2>/dev/null git push -f -q https://cwpearson:$GITHUB_TOKEN@github.com/cwpearson/cwpearson.github.io master &2> /dev/null
cd "$TRAVIS_BUILD_DIR" cd "$TRAVIS_BUILD_DIR"
fi fi