forked from lmu-osc/Collaborative-RStudio-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (94 loc) · 3.11 KB
/
Copy pathpublish.yaml
File metadata and controls
106 lines (94 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
on:
workflow_dispatch:
schedule:
- cron: "0 23 * * 0"
push:
branches: [main]
name: Render Quarto Site
jobs:
quarto-publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt install -y \
libcurl4-openssl-dev \
libfontconfig1-dev \
libssl-dev \
libxml2-dev \
libpng-dev \
libjpeg-dev \
libtiff-dev \
libcairo2-dev \
libxt-dev \
libfreetype6-dev \
libharfbuzz-dev \
libfribidi-dev \
zlib1g-dev \
libv8-dev \
libglpk-dev \
librsvg2-bin
- name: Install R with renv
uses: r-lib/actions/setup-r@v2
with:
r-version: renv
if: ${{ hashFiles('renv.lock') != '' }}
- name: Install R Dependencies with renv
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 1
if: ${{ hashFiles('renv.lock') != '' }}
- name: Install R latest
uses: r-lib/actions/setup-r@v2
if: ${{ hashFiles('renv.lock') == '' }}
- name: Set R library path (no lockfile)
run: echo "R_LIBS_USER=$HOME/.local/lib/R/site-library" >> "$GITHUB_ENV"
if: ${{ hashFiles('renv.lock') == '' }}
- name: Cache R library (no lockfile)
uses: actions/cache@v4
with:
path: ~/.local/lib/R/site-library
key: ${{ runner.os }}-r-nolock-${{ hashFiles('**/*.R', '**/*.Rmd', '**/*.qmd', '_quarto.yml') }}
restore-keys: |
${{ runner.os }}-r-nolock-
if: ${{ hashFiles('renv.lock') == '' }}
- name: Install R latest dependencies
run: |
lib <- Sys.getenv("R_LIBS_USER")
if (nzchar(lib)) {
dir.create(lib, recursive = TRUE, showWarnings = FALSE)
.libPaths(c(lib, .libPaths()))
}
install.packages("renv")
install.packages("rmarkdown")
install.packages("yaml")
deps <- unique(stats::na.omit(renv::dependencies()$Package))
if (length(deps) > 0) install.packages(deps)
shell: Rscript {0}
if: ${{ hashFiles('renv.lock') == '' }}
- name: Ensure Quarto R runtime packages
run: |
lib <- Sys.getenv("R_LIBS_USER")
if (nzchar(lib)) {
dir.create(lib, recursive = TRUE, showWarnings = FALSE)
.libPaths(c(lib, .libPaths()))
}
pkgs <- c("knitr", "rmarkdown")
missing <- pkgs[!vapply(pkgs, requireNamespace, logical(1), quietly = TRUE)]
if (length(missing) > 0) install.packages(missing)
shell: Rscript {0}
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}