From 86d87656745c6093bb8a7196fe09e379c22e8824 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 6 Apr 2017 13:57:34 +0800 Subject: [PATCH] use travis deploy --- .travis-deploy.sh | 19 ------------------- .travis.yml | 23 ++++++++++++++++------- 2 files changed, 16 insertions(+), 26 deletions(-) delete mode 100755 .travis-deploy.sh diff --git a/.travis-deploy.sh b/.travis-deploy.sh deleted file mode 100755 index e8e6dc2..0000000 --- a/.travis-deploy.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -name="Dongdong Tian" -mail="seisman.info@gmail.com" -docdir=pdf -pdfname=Makefile.pdf - -echo "In master branch, deploying now..." -git config user.name "${name}" -git config user.email "${mail}" - -# Deploy Github Pages -ghp-import -b gh-pages -n build/html -m 'Update by travis automatically' -git push "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages --force --quiet - -# Deploy offline HTML and PDF files -mkdir build/${docdir} && cd build -cp latex/${pdfname} ${docdir}/ -ghp-import -b ${docdir} ${docdir} -m 'Update by travis automatically' -git push "https://${GH_TOKEN}@${GH_REF}" ${docdir}:${docdir} --force --quiet diff --git a/.travis.yml b/.travis.yml index 5071b56..76c2190 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python python: - - "3.5" + - "3.6" sudo: required dist: trusty @@ -8,15 +8,24 @@ dist: trusty branches: only: - master + - dev install: - - pip install -r requirements.txt - - bash ./.texlive-minmal-installer.sh - - source ./srcfile + - pip install -r requirements.txt + - bash ./.texlive-minmal-installer.sh + - source ./srcfile script: - - make html - - make xelatexpdf + - make html + - make xelatexpdf after_success: - bash ./.travis-deploy.sh + - cp build/latex/Makefile.pdf build/html/ + +deploy: + provider: pages + skip_cleanup: true + github_token: ${GH_TOKEN} + local_dir: build/html + on: + branch: master