-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 2.38 KB
/
render.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
on:
push:
# branches:
# - master
pull_request:
branches:
- main
name: render
jobs:
render:
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel
name: render
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Install renv
run: |
options(repos = c(CRAN = "https://cran.r-project.org"))
install.packages(c('renv', 'remotes'))
shell: Rscript {0}
- name: Cache renv
uses: actions/cache@v1
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-1-${{ hashFiles('renv.lock') }}
restore-keys: ${{ runner.os }}-renv-1-
- name: Restore renv
run: |
renv::restore()
shell: Rscript {0}
# This lets us augment with additional dependencies
- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
echo $sysreqs
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y update
sudo -s eval "$sysreqs"
- name: Session info
run: |
install.packages('sessioninfo', Ncpus = 2L)
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Render site
run: |
install.packages('rmarkdown', Ncpus = 2L)
rmarkdown::render(input = "index.Rmd")
shell: Rscript {0}
- name: Prepare files to deploy
run: |
mkdir _site
cp -r img libs my-theme.css index.html _site/
# deploy needs rsync? Seems so.
- name: Install deploy dependencies
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
apt-get update && apt-get -y install rsync
- name: Deploy 🚀
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: _site