where I can talk.

使用 Travis CI 自动部署 Simiki

· Read in about 1 min · (102 Words)
Travis CI Hexo Github

.travis.yml

language: python

python:
  - '3.6'

sudo: required

cache: pip

branches:
  only:
    - master

before_install:
  - openssl aes-256-cbc -K $encrypted_b84974610e74_key -iv $encrypted_b84974610e74_iv
    -in travis-ci.key.enc -out ~/.ssh/id_rsa -d
  - chmod 600 ~/.ssh/id_rsa
  - mv -fv ssh_conf ~/.ssh/config
  - chmod +x ./deploy.sh

install:
  - pip install simiki

script:
  - simiki g

after_success:
  - ./deploy.sh

deploy.sh

#!/bin/bash

set -ev
export TZ='Asia/Shanghai'

git config --global user.name "{$GIT_USER_NAME}"
git config --global user.email "{$GIT_USER_EMAIL}"

git clone -b gh-pages $GITHUB_REPO .deploy_git

cd .deploy_git
git checkout gh-pages
cp -r ../output/* ./

git add .
git commit -m "Site updated by Travis CI:`date +"%Y-%m-%d %H:%M:%S"`"

git push origin gh-pages --force --quiet

Comments