【发布时间】:2017-03-21 03:41:48
【问题描述】:
我的最终目标是能够在我的 Jekyll 博客上安排帖子。每当我提交到 Github 中的主分支时,我都会使用 Travis-CI 将 /_site/ 的内容部署到 S3 存储桶。
Travis-CI 流程按预期工作,但事实是,除非我在本地构建我的站点并将新的 /_site/ 文件夹直接推送到 master,否则未构建并添加到 /_site/ 目录的新页面。这些帖子存在于 /_posts/ 中,但不会像每天重建网站时那样自动构建并添加到 /_site/。
我的 travis.yml 文件在下面。
language: ruby
rvm:
- 2.3.3
# before_script:
# - chmod +x ./script/cibuild # or do this locally and commit
# Assume bundler is being used, therefore
# the `install` step will run `bundle install` by default.
install: gem install jekyll html-proofer jekyll-twitter-plugin
script: jekyll build && htmlproofer ./_site
# branch whitelist, only for GitHub Pages
branches:
only:
- master
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
exclude: [vendor]
sudo: false # route your build to the container-based infrastructure for a faster build
deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: $S3_BUCKET
local_dir: _site
【问题讨论】: