Correct web page links in readme #148
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: | |
- book | |
name: renderbook | |
jobs: | |
bookdown: | |
name: Render-Book | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@master | |
- uses: r-lib/actions/setup-pandoc@v1 | |
with: | |
pandoc-version: '2.7.3' # The pandoc version to download (if necessary) and use. | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
shell: Rscript {0} | |
- name: Cache R packages | |
uses: actions/cache@v1 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: macOS-r-4.0-1- | |
- name: Install dependencies | |
run: | | |
install.packages("remotes") | |
remotes::install_deps(dependencies = TRUE) | |
# tinytex::install_tinytex() | |
shell: Rscript {0} | |
- name: Set up Python 3.6 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.6 | |
- name: Install dependencies | |
run: pip3 install --user -r requirements.txt | |
- name: Render Book | |
run: make html | |
- name: Cache bookdown results | |
uses: actions/cache@v1 | |
with: | |
path: _bookdown_files | |
key: bookdown-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown- | |
- 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 UNIQUE_PAT and EMAIL to the repository | |
# gh-action from Cecilapp/GitHub-Pages-deploy | |
checkout-and-deploy: | |
runs-on: ubuntu-latest | |
needs: bookdown | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Download artifact | |
uses: actions/download-artifact@v1.0.0 | |
with: | |
# Artifact name | |
name: _book # optional | |
# Destination path | |
path: _book # optional | |
- name: Deploy to GitHub Pages | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/settings/tokens | |
with: | |
build_dir: _book/ | |
email: lwjohnst@gmail.com | |