This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
name: renderbook | |
jobs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make new project directory | |
mkdir testbookdown | |
cd testbookdown | |
# Download bookdown demo project | |
wget https://github.com/rstudio/bookdown-demo/archive/master.zip | |
# Unzip it in project directory | |
unzip master.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!requireNamespace("devtools")) install.packages('devtools') | |
devtools::install_github('rstudio/bookdown') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd testbookdown/bookdown-demo-master | |
rstudio bookdown-demo.Rproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bookdown::serve_book() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove files we don't need | |
rm .travis.yml DESCRIPTION Dockerfile _build.sh _deploy.sh now.json .gitignore | |
# create new .gitignore | |
echo " | |
# don't push local rendered files in master branch | |
_book/ | |
_bookdown_files/ | |
libs/ | |
**/*.bib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connect to Github Repo | |
git remote add [email protected]:<username>/<repository-name>.git | |
# Push to master | |
git push origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make a new branch with no parents and disconnected from all other branches | |
git checkout --orphan gh-pages | |
# Remove all files from the working tree | |
git rm -rf . | |
# Make an empty commit | |
git commit --allow-empty -m 'Initial gh-pages commit' | |
# Pushing to remote will create gh-pages branch on the remote repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usethis::use_github_action(url = "https://raw.githubusercontent.com/ropenscilabs/actions_sandbox/master/.github/workflows/deploy_bookdown.yml") |