Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed Sep 20, 2024
1 parent 354550c commit 8122852
Showing 1 changed file with 15 additions and 30 deletions.
45 changes: 15 additions & 30 deletions .github/workflows/bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,34 @@ 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
- name: Checkout repository
uses: actions/checkout@v4

#- name: Setup upterm session
#uses: lhotari/action-upterm@v1

- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y curl libcurl4-doc libcurl4-openssl-dev \
libharfbuzz-dev libfribidi-dev libmagick++-dev libpoppler-cpp-dev \
texlive-extra-utils ghostscript
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Install tinyTeX
uses: r-lib/actions/setup-tinytex@v2

- 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: Install rmarkdown, bookdown and sysfonts
run: Rscript -e 'install.packages(c("sysfonts","rmarkdown","bookdown"))'

- name: Cache R packages
uses: actions/cache@v3
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
r-version: 'release'

- name: Restore R packages
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
- name: Install R dependencies via renv
uses: r-lib/actions/setup-renv@v2

- name: Cache bookdown results
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: _bookdown_files
key: bookdown-2-${{ hashFiles('**/*Rmd') }}
Expand All @@ -69,7 +54,7 @@ jobs:
run: |
Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::pdf_book")'
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: _handbook
path: _handbook/
Expand Down

0 comments on commit 8122852

Please sign in to comment.