rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 334 forks source link

Automatic deployment using Travis CI #26

Closed pat-s closed 7 years ago

pat-s commented 7 years ago

@yihui Referring to your comment: http://disq.us/p/1eyc771

Is there already a setup for Travis CI to use automatic deployment? Your travis.yml does not seem to do deployment right now? ATM I´m using wercker as this is suggested by Hugo. While this works using a "two repo" solution with Github pages, the deploy script does not support .Rmd files but only .md files.

Wercker.yml

box: golang:latest

build:
  steps:
    - script:
        name: initialize and update git submodules
        code: |
            git submodule init
            git submodule update --remote --recursive
    - arjen/hugo-build:
        version: "HEAD"
        theme: academic

deploy:
  steps:
    - install-packages:
            packages: git
    - leipert/git-push:
            gh_oauth: $GIT_TOKEN
            repo: pat-s/pat-s.github.io
            branch: master
            basedir: public
dfalbel commented 7 years ago

@jtrecenti have done this here: https://github.com/curso-r/verao2017

basicaly, we changed .travis.yml to this:

language: r
cache: packages

before_script:
  - chmod +x ./_build.sh
  - chmod +x ./_deploy.sh

script:
  - ./_build.sh
  - ./_deploy.sh

See also _build.sh, _deploy.sh and build.R files. You also need to add a github path to Travis

yihui commented 7 years ago

I forgot to mention that I had documented this at https://bookdown.org/yihui/blogdown/travis-github.html. Using the native support for Github Pages on Travis may be a better idea than a custom shell script _deploy.sh.