-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
132 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
name: booklet | ||
|
||
jobs: | ||
bookdown: | ||
name: build-bookdown | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
RENV_PATHS_ROOT: ~/.local/share/renv | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
#- name: Setup upterm session | ||
#uses: lhotari/action-upterm@v1 | ||
|
||
- name: Setup R | ||
uses: r-lib/actions/setup-r@master | ||
with: | ||
r-version: '4.1.1' | ||
|
||
- name: Install pandoc | ||
uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- name: Install tinyTeX | ||
uses: r-lib/actions/setup-tinytex@v1 | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt install -y curl libcurl4-doc libcurl4-openssl-dev libmagick++-dev libpoppler-cpp-dev texlive-extra-utils ghostscript | ||
- name: Cache R packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.RENV_PATHS_ROOT }} | ||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-renv- | ||
- name: Restore R packages | ||
shell: Rscript {0} | ||
run: | | ||
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") | ||
renv::restore() | ||
- name: Cache bookdown results | ||
uses: actions/cache@v2 | ||
with: | ||
path: _bookdown_files | ||
key: bookdown-2-${{ hashFiles('**/*Rmd') }} | ||
restore-keys: bookdown-2- | ||
|
||
- name: Render book HTML | ||
run: | | ||
Rscript -e 'bookdown::clean_book(TRUE)' | ||
Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)' | ||
- name: Render book PDF | ||
run: | | ||
Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::pdf_book")' | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: _book | ||
path: _book/ | ||
|
||
# Need to first create an empty gh-pages branch | ||
# see https://pkgdown.r-lib.org/reference/deploy_site_github.html | ||
# and also add secrets for a GH_PAT and EMAIL to the repository | ||
# gh-action from https://github.com/Cecilapp/GitHub-Pages-deploy | ||
checkout-and-deploy: | ||
runs-on: ubuntu-latest | ||
needs: bookdown | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download Artifact | ||
uses: actions/[email protected] | ||
with: | ||
# Artifact name | ||
name: _book # optional | ||
# Destination path | ||
path: _book # optional | ||
|
||
- name: Abbreviate Git SHA | ||
run: echo "GITHUB_SHA_SHORT=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: Cecilapp/GitHub-Pages-deploy@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
email: ${{ secrets.EMAIL }} # must be a GitHub-verified email | ||
build_dir: _book/ # "_site/" by default | ||
commit_message: Update book via ${{ env.GITHUB_SHA_SHORT }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
# The `tlverse` handbook | ||
|
||
[](https://travis-ci.com/tlverse/tlverse-handbook) | ||
Note: `travis-ci` currently deploys the developmental version of this workshop | ||
handbook into the `gh-pages` branch of this repository, which is hosted by | ||
GitHub Pages at https://tlverse.org/tlverse-handbook. | ||
# The `tlverse` handbook [](https://github.com/tlverse/tlverse-handbook/actions/workflows/bookdown.yml) | ||
|
||
Welcome to the GitHub repository for drafts of [**Targeted Learning in `R`: | ||
Causal Data Science with the `tlverse` Software | ||
Ecosystem**](http://tlverse.org/tlverse-handbook), by Mark van der Laan, Jeremy | ||
Coyle, Nima Hejazi, Ivana Malenica, Rachael Phillips, and Alan Hubbard. This | ||
draft is work-in-progress and updates are made available frequently. The book is | ||
A Causal Data Science Handbook**](http://tlverse.org/tlverse-handbook), by Mark | ||
van der Laan, Jeremy Coyle, Nima Hejazi, Ivana Malenica, Rachael Phillips, and | ||
Alan Hubbard. This draft is work-in-progress and updates are made available | ||
frequently. The draft has been made publicly available in order to solicit | ||
feedback (and errata) transparently from the interested community. The book is | ||
built using RStudio's | ||
[`bookdown`](https://www.rstudio.com/resources/webinars/introducing-bookdown/) | ||
`R` package; for more information on how to use `bookdown` see | ||
[bookdown.org](https://bookdown.org/). | ||
`R` package; see [bookdown.org](https://bookdown.org/) for more information on | ||
how to use `bookdown`. The online book is automatically built and deployed via | ||
[GitHub Actions](https://github.com/features/actions) and served to | ||
https://tlverse.org/tlverse-handbook by [GitHub | ||
Pages](https://pages.github.com/). |
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
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