Skip to content

Commit db91dc0

Browse files
author
jsdearbo
committed
Fix renv lockfile: use DESCRIPTION + renv::install so project library is populated before snapshot
1 parent c4edb5f commit db91dc0

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ jobs:
2323
- name: Install system dependencies for R packages
2424
run: sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
2525

26+
- name: Build renv lockfile with correct CRAN mirror
27+
run: |
28+
Rscript -e "
29+
app_dir <- normalizePath('shiny_apps/gwat_portfolio')
30+
options(repos = c(CRAN = 'https://cloud.r-project.org'))
31+
install.packages('renv', repos = 'https://cloud.r-project.org')
32+
writeLines(c(
33+
'Package: gwatrnaseq',
34+
'Title: gWAT RNA-seq Explorer',
35+
'Version: 1.0.0',
36+
'Imports: shiny, plotly, dplyr, stringr'
37+
), file.path(app_dir, 'DESCRIPTION'))
38+
renv::init(project = app_dir, bare = TRUE, restart = FALSE)
39+
renv::install(c('shiny', 'plotly', 'dplyr', 'stringr'), prompt = FALSE)
40+
renv::snapshot(project = app_dir, type = 'explicit', prompt = FALSE)
41+
"
42+
2643
- name: Deploy to shinyapps.io
2744
env:
2845
SHINYAPPS_NAME: ${{ secrets.SHINYAPPS_NAME }}
@@ -31,8 +48,7 @@ jobs:
3148
run: |
3249
Rscript -e "
3350
options(repos = c(CRAN = 'https://cloud.r-project.org'))
34-
install.packages(c('renv', 'rsconnect', 'shiny', 'plotly', 'dplyr', 'stringr'),
35-
repos = 'https://cloud.r-project.org', Ncpus = 2)
51+
install.packages('rsconnect', repos = 'https://cloud.r-project.org')
3652
rsconnect::setAccountInfo(
3753
name = Sys.getenv('SHINYAPPS_NAME'),
3854
token = Sys.getenv('SHINYAPPS_TOKEN'),

0 commit comments

Comments
 (0)