-
Notifications
You must be signed in to change notification settings - Fork 79
73 lines (63 loc) · 1.83 KB
/
build_site.yaml
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
on:
push:
branches:
- main
- master
paths:
- 'content/**'
- 'config.toml'
- 'themes/**'
- 'static/**'
- 'layouts/**'
- 'ressources/**'
- '.github/workflows/build_site.yaml'
name: Build and deploy website
jobs:
build:
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install R
uses: r-lib/actions/setup-r@v2
id: install-r
with:
r-version: '4.1.1'
use-public-rspm: true
- name: Cache Renv packages
uses: actions/cache@v3
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-1-${{ hashFiles('R/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-1-
${{ runner.os }}-renv-
- name: Install packages
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore(repos = "https://packagemanager.rstudio.com/all/latest")
shell: Rscript {0}
working-directory: R
- name: Session info
run: |
options(width = 100)
renv::install("cli")
renv::install("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
working-directory: R
- name: Install hugo
run: |
blogdown::install_hugo()
shell: Rscript {0}
working-directory: R
- name: build and publish
env:
RSC_BOOKDOWN_ORG_TOKEN: ${{ secrets.RSC_BOOKDOWN_ORG_TOKEN }}
CONTENT_ID: 11
run: Rscript publish.R
working-directory: R