where I can talk.

使用 Travis CI 自动部署 Hugo

· Read in about 1 min · (81 Words)
Travis CI Hugo Github

.travis.yml

language: go
# Install dependencies
# https://docs.travis-ci.com/user/installing-dependencies#installing-snap-packages-with-the-snaps-addon
dist: xenial

addons:
  snaps:
  - hugo

before_script:
  - rm -rf public 2> /dev/null

script:
  - hugo
# Deploy
# https://docs.travis-ci.com/user/deployment/pages/
deploy:
  local_dir: public # Directory to push to GitHub Pages
  repo: $GITHUB_REP # Repo slug
  target_branch: master # Branch to push local-dir contents to
  provider: pages
  skip_cleanup: true
  keep_history: true # create incremental commit instead of doing push force
  github_token: $GITHUB_TOKEN
  email: $GITHUB_EMAIL # committer info
  name: $GITHUB_NAME # committer
  on:
    branch: source

Comments