-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (205 loc) · 7.98 KB
/
tut-build-publish.yml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Render and publish the tutorials
on:
workflow_dispatch:
# pull_request:
# push:
# branches: ['release']
jobs:
render-tutorials:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
name: ${{ matrix.config.r }}
strategy:
fail-fast: false
matrix:
config:
- { r: '4.3.3' }
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensure that more than the last commit is checked out so that we can get time stamps
# Restore the timestamps - I am going to try to use these to work out what is new and what is not
- name: Restore Timestamps
uses: chetan/git-restore-mtime-action@v1
# Install system dependencies
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev make ImageMagick
# install graphviz
- name: Install Graphviz
run: sudo apt-get install graphviz
# install R
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.R }}
- name: Repos
run: |
cat("\noptions(repos=c(stan='https://mc-stan.org/r-packages/',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
shell: Rscript {0}
## Install R packages
- name: install R packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
packages: |
any::rmarkdown
any::magick
any::pdftools
any::quarto
any::tidyverse
any::mvabund
any::pander
any::GGally
any::plotrix
any::PBSmapping
any::gmodels
any::mvtnorm
any::coda
any::gganimate
any::gridExtra
any::ggfortify
any::DHARMa
any::glmmTMB
any::performance
any::see
stan-dev/cmdstanr
any::brms
any::knitr
any::simstudy
any::sf
any::stars
any::gstat
any::patchwork
any::remotes
any::inlabru
any::Hmisc
any::igraph
any::ggraph
any::easystats
any::gridGraphics
any::HDInterval
any::bayestestR
any::emmeans
any::gert
any::usethis
github::jmgirard/standist
- name: Install other R packages
run: |
Rscript -e "install.packages('INLA',repos=c(getOption('repos'),INLA='https://inla.r-inla-download.org/R/stable'), dep=TRUE)"
Rscript -e "install.packages('RandomFields', repos = c('https://spatstat.r-universe.dev', 'https://cloud.r-project.org'))"
Rscript -e "install.packages('RandomFieldsUtils', repos = c('https://spatstat.r-universe.dev', 'https://cloud.r-project.org'))"
Rscript -e "install.packages('tidybayes')"
Rscript -e "remotes::install_github('jmgirard/standist')"
- name: Install CmdStan
shell: Rscript {0}
run: |
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = parallel::detectCores())
#install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
#cmdstanr::check_cmdstan_toolchain(fix = TRUE)
#cmdstanr::install_cmdstan(cores = 2)
#version <- "2.35.0"
#url <- sprintf("https://github.com/stan-dev/cmdstan/releases/download/v%s/cmdstan-%s.tar.gz", version, version)
#cmdstanr::install_cmdstan(cores = 2, release_url = url)
#cmdstanr::check_cmdstan_toolchain(fix = TRUE)
#cmdstanr::install_cmdstan(cores = 2)
#cmdstan <- file.path(Sys.getenv("RUNNER_TEMP"), "cmdstan")
#file.rename(cmdstanr::cmdstan_path(), cmdstan)
#lines <- paste0("\nCMDSTAN=", cmdstan, "\n")
#cat(lines, file = "~/.Renviron", append = TRUE)
cmdstanr:::get_cmdstan_flags("STANCFLAGS")
cmdstanr::cmdstanr_example()
- name: install tinytex
uses: r-lib/actions/setup-tinytex@v2
- run: |
tlmgr --version
tlmgr update --self
- name: Install additional LaTeX packages
run: |
tlmgr install titlesec
tlmgr list --only-installed
- name: Install Google Fonts
run: |
## The following wget can no longer be performed as google returns a html rather than a zip
#wget -O Architects_Daughter.zip https://fonts.google.com/download?family=Architects%20Daughter
# unzip -d architects_daughter/ Architects_Daughter.zip
# mv architects_daughter /usr/share/fonts/
unzip -d architects_daughter/ resources/Architects_Daughter.zip
mv architects_daughter /usr/share/fonts/
#wget -O inconsolata.zip https://fonts.google.com/download?family=Inconsolata
unzip -d inconsolata/ resources/Inconsolata.zip
mv inconsolata /usr/share/fonts/
mv resources/Inconsolata_Nerd_Font_Regular.ttf /usr/share/fonts/
#wget -O noto_sans.zip https://fonts.google.com/download?family=Noto%20Sans
unzip -d noto_sans/ resources/Noto_Sans.zip
mv noto_sans /usr/share/fonts/
unzip -d ubuntu/ resources/Ubuntu.zip
mv ubuntu /usr/share/fonts/
fc-cache -fv
fc-list
##fc-list -v | grep -i archi
##fc-list -v | grep -i inconsolata
##fc-list -v | grep -i noto
# install quarto
- name: Install quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Change ImageMagick policy to allow pdf->png conversion.
run: |
sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
# configure git
- name: Configure git
run: |
git config --global user.name "pcinereus"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main
# Checkout the gh-pages branch into the tut folder
# - name: Retrieve previous compiled pages
# uses: actions/checkout@v4
# with:
# path: tut # Specify the target folder for checkout
# ref: gh-pages
- name: Touch those files that have changed since the last commit
run: |
git diff --name-only HEAD HEAD~1 | xargs touch
# - name: Check that the docs folder is there and populated
# run: |
# ls -la
# ls -la docs
# ls -la tut
# Download artifacts
#- name: download artifacts
# uses: actions/download-artifact@v4
# with:
# name: artifact
# github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
# path: data
# run-id: 8493870822
#- name: Display structure of downloaded files
# run: ls -R data
# render tutorials
- name: Make tutorials
run: |
mkdir ~/tmp
echo "library(quarto); quarto_render(\"tut/index.qmd\")" | R --no-save --no-restore;
#make -i tut
make -i pres
#run: |
# echo "library(quarto); quarto_render(\"tut/index.qmd\")" | R --no-save --no-restore;
# echo "library(quarto); quarto_render(\"tut/10_git.qmd\")" | R --no-save --no-restore;
# upload artifacts
#- name: upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: artifact
# path: data/reef_data_synthetic_*.csv
# if-no-files-found: ignore
# overwrite: true
# Deploy site to gh-pages branch
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs