Skip to content

Commit 3560a0e

Browse files
committed
update github action to newer
1 parent 00b215c commit 3560a0e

File tree

2 files changed

+53
-27
lines changed

2 files changed

+53
-27
lines changed

.github/workflows/quarto_render.yml

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,66 @@
1+
# on:
2+
# push:
3+
# branches:
4+
# - main
5+
#
6+
# name: Render quarto project
7+
#
8+
# permissions:
9+
# contents: write
10+
# pages: write
11+
#
12+
# jobs:
13+
# build-deploy:
14+
# runs-on: ubuntu-latest
15+
# steps:
16+
# - name: Check out repository
17+
# uses: actions/checkout@v4
18+
#
19+
# - name: Set up Quarto
20+
# uses: quarto-dev/quarto-actions/setup@v2
21+
# env:
22+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
# with:
24+
# tinytex: true
25+
#
26+
# - name: Setup R
27+
# uses: r-lib/actions/setup-r@v2
28+
#
29+
# - name: Render Quarto Project
30+
# uses: quarto-dev/quarto-actions/render@v2
31+
# with:
32+
# to: html # If set, it will be equivalent to `quarto render --to html`
33+
# - name: Publish
34+
# uses: quarto-dev/quarto-actions/publish@v2
35+
# with:
36+
# target: gh-pages
37+
# render: false
38+
# env:
39+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
141
on:
42+
workflow_dispatch:
243
push:
3-
branches:
4-
- main
5-
6-
name: Render quarto project
44+
branches: main
745

8-
permissions:
9-
contents: write
10-
pages: write
46+
name: Quarto Publish
1147

1248
jobs:
1349
build-deploy:
1450
runs-on: ubuntu-latest
51+
permissions:
52+
contents: write
1553
steps:
1654
- name: Check out repository
1755
uses: actions/checkout@v4
18-
56+
1957
- name: Set up Quarto
2058
uses: quarto-dev/quarto-actions/setup@v2
21-
env:
22-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
with:
24-
tinytex: true
25-
26-
- name: Setup R
27-
uses: r-lib/actions/setup-r@v2
2859

29-
- name: Render Quarto Project
30-
uses: quarto-dev/quarto-actions/render@v2
31-
with:
32-
to: html # If set, it will be equivalent to `quarto render --to html`
33-
- name: Publish
60+
- name: Render and Publish
3461
uses: quarto-dev/quarto-actions/publish@v2
3562
with:
3663
target: gh-pages
37-
render: false
3864
env:
3965
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4066

quarto-eth-phd-thesis.qmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Also in the `.Rprofile` are some functions to streamline uniform styling of figu
149149

150150
For tables the `thesis_tbl()` function sets options for `knitr::kbl()` and `kableExtra::kable_styling()` to produce booktabs style tables, with center aligned content and bold column titles:
151151

152-
```{r}
152+
```{r, eval=FALSE}
153153
thesis_tbl <- function(x, escape, ltable = FALSE) {
154154
x %>%
155155
kbl(digits = 3,
@@ -171,7 +171,7 @@ thesis_tbl <- function(x, escape, ltable = FALSE) {
171171

172172
An example of applying this function is included in `chapters/paper-01-qmd`:
173173

174-
```{r}
174+
```{r, eval=FALSE}
175175
#| tbl-pos: H
176176
177177
#load csv of allocation parameter summary statistics
@@ -188,7 +188,7 @@ Calibration_summary %>%
188188

189189
For figures the function `theme_publication()` sets a custom `ggplot2` theme:
190190

191-
```{r}
191+
```{r, eval=FALSE}
192192
#' theme_publication
193193
#'
194194
#' custom ggplot2 theme to apply to all plots
@@ -235,7 +235,7 @@ theme_thesis <- function(
235235

236236
In addition the `.Rprofile` contains a series of functions for producing custom continuous and discrete color palettes with the base set of colors specified within the function `thesis_color()`:
237237

238-
```{r}
238+
```{r, eval=FALSE}
239239
thesis_color <- function(...) {
240240
241241
thesis_colors <- c(
@@ -270,7 +270,7 @@ thesis_color <- function(...) {
270270

271271
These color palettes can be applied using defined `ggplot2::scale_color_*` and `ggplot2::scale_fill_*` methods. An example of applying the `theme_thesis()` and `scale_color_thesis()` functions is provided in `chapters/paper-01/paper-01-figs.R:`
272272

273-
```{r}
273+
```{r, eval=FALSE}
274274
p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
275275
geom_point(size = 3) +
276276
labs(
@@ -393,7 +393,7 @@ The code for this is included in `chapters/paper-01/paper-01.qmd` and it uses th
393393

394394
My preferred method of preparing figures for Quarto documents is to produce and save them via dedicated R scripts rather than directly within the `.qmd` files themselves. This R script is then sourced directly at the head of the respective `.qmd` file to ensure the most up to date figures are used and the images are then included for each figure as in `paper-01.qmd`:
395395

396-
```{r}
396+
```{r, eval=FALSE}
397397
#source the script that prepares all the figures
398398
source("chapters/paper-01/paper-01-figs.R")
399399

0 commit comments

Comments
 (0)