Open jasdumas opened 7 years ago
pre-requisites: GitHub repository creation with content
library(devtools)
create_description()
Create .travis.yml file
Add the build badge [![](https://api.travis-ci.org/username/repo.svg?branch=master)](https://travis-ci.org/username/repo)
Create Personal Access Token at www.github.com/settings/tokens and paste value into file outside repo, eg /FOLDER_LOCATION/.gh-token-the-republic-push
Create _push.sh
file
#!/bin/sh
# info: https://github.com/SustainSB/sustainsb.github.io/issues/2
export GH_OWNER=jasdumas
export GH_REPO=the-republic
export GH_BRANCH=master
# setup git
git config --global user.email "jasmine.dumas@gmail.com"
git config --global user.name "jasdumas"
git config --global push.default matching
# git commit
git checkout ${GH_BRANCH}
git add --all
git commit -am "Travis $TRAVIS_EVENT_TYPE [skip ci]: build $TRAVIS_BUILD_NUMBER"
# git push
git remote add upstream "https://${GH_TOKEN}@github.com/${GH_OWNER}/${GH_REPO}.git"
git push -q upstream ${GH_BRANCH}
AND the _render.sh
file
#!/usr/bin/env Rscript
library(rmarkdown)
#rmds = list.files('.', '*.\\.Rmd')
#rmds = c('prep_layers.Rmd')
#rmds = c('test.Rmd')
rmds = c('web_scraping_sots_election_app.Rmd')
for (rmd in rmds){
rmarkdown::render(rmd)
}
gem install travis
cd the-republic
echo GH_TOKEN=`cat /Users/jasminedumas/Desktop/GitHub Clone Repos/.gh-token-the-republic-push` | travis encrypt --add
Trying some things out by following Ben's issue: https://github.com/SustainSB/sustainsb.github.io/issues/2#issuecomment-304355281 . hence the newer files in the last commit for _push.sh and _render.sh. Stuck on encrypting my GH PAT π’
Trying out the Cron daily build on travis now