【问题标题】:Travis-CI: S3 deploy script is not adding new filesTravis-CI:S3 部署脚本未添加新文件
【发布时间】: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

【问题讨论】:

    标签: jekyll travis-ci


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-04
        • 2019-06-13
        • 1970-01-01
        • 2018-01-31
        • 1970-01-01
        • 1970-01-01
        • 2016-09-13
        • 1970-01-01
        相关资源
        最近更新 更多