Travis-CI:S3 部署脚本不会添加新文件



我的最终目标是能够在我的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

我想通了:Travis-CI 部署 gem 不包含构建步骤。它只是将存储库的内容推送到 S3。我更新了构建脚本以作为构建和验证步骤的一部分进行推送。

您必须在部署指令上将选项skip_cleanup设置为 true

最新更新