Skip to content

Commit 989604a

Browse files
authored
Fix Quarto CI R dependencies
1 parent ef44748 commit 989604a

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/preview.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ jobs:
2222
uses: quarto-dev/quarto-actions/setup@v2
2323

2424
- name: Setup R
25-
if: ${{ !github.event.pull_request.head.repo.fork }}
2625
uses: r-lib/actions/setup-r@v2
2726

28-
- name: Render (trusted PRs)
29-
if: ${{ !github.event.pull_request.head.repo.fork }}
30-
run: quarto render .
27+
- name: Setup R dependencies
28+
uses: r-lib/actions/setup-r-dependencies@v2
29+
with:
30+
extra-packages: |
31+
any::knitr
32+
any::rmarkdown
3133
32-
- name: Render (fork PRs without execution)
33-
if: ${{ github.event.pull_request.head.repo.fork }}
34+
- name: Render
3435
run: quarto render . --execute false
3536

3637
- name: Deploy PR Preview

.github/workflows/publish.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@ jobs:
2121
- name: Setup R
2222
uses: r-lib/actions/setup-r@v2
2323

24+
- name: Setup R dependencies
25+
uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: |
28+
any::knitr
29+
any::rmarkdown
30+
2431
- name: Render Quarto
25-
run: quarto render .
32+
run: quarto render . --execute false
2633

2734
- name: Deploy 🚀
2835
uses: JamesIves/github-pages-deploy-action@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ All members of the Strategy Unit organisation on Github should be able to contri
5252

5353
### Potential issues
5454

55-
The GitHub action runner does not have R installed on it, so as mentioned above, all computations must be run locally and then added to the _freeze folder.
55+
The GitHub action installs a minimal R setup so Quarto can render pages that rely on `knitr`/`rmarkdown`, but the workflows still render with `--execute false`. As mentioned above, all computations must still be run locally and then added to the `_freeze` folder.
5656

5757
#### code-fold blocks
5858

0 commit comments

Comments
 (0)