Publishing R Quarto Book using Github Actions

I followed the instructions at the Freezing Computations section to try and publish a Test Quarto book with R while freezing computations so that I don't need to worry about dependencies on GH actions. However, when I copied the Publish Action publish.yml file the book didn't just work as I expected.

The Render and Publish step failed with error

ERROR: Error executing 'Rscript': No such file or directory (os error 2)

I thought it was supposed to just copy the results from _freeze but then why are R/Rscript needed?

Here is my full build log

You need to install R, like in this workflow: GitHub Pages – Quarto

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

I tried that but then the next error I get is

ERROR: Error executing '/usr/local/bin/Rscript': Broken pipe (os error 32)
R installation:
  Version: 4.4.2
  Path: /opt/R/4.4.2/lib/R
  LibPaths:
    - /home/runner/work/OvarianOutcomes/OvarianOutcomes/renv/library/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu
    - /home/runner/.cache/R/renv/sandbox/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu/db5e602d
  knitr: (None)
  rmarkdown: (None)

The knitr package is not available in this R installation.
Install with install.packages("knitr")

The rmarkdown package is not available in this R installation.
Install with install.packages("rmarkdown")

Does that mean I need to install R dependencies too? Then wouldn't we just be doing the the second workflow in your link? Is there a way to use the freeze results and publish using the first workflow

I would guess that you need to combine the two workflows, yes.