-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.R
More file actions
27 lines (23 loc) · 954 Bytes
/
deploy.R
File metadata and controls
27 lines (23 loc) · 954 Bytes
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
library(rsconnect)
# Courtesy of https://github.com/RMHogervorst/testshiny/blob/main/deploy.R
# See https://www.r-bloggers.com/2021/02/deploy-to-shinyapps-io-from-github-actions/
# Print a list of app dependencies. Libraries need to be loaded
# before publishing so deployApp() knows what is necessary.
error_on_missing_name <- function(name){
var <- Sys.getenv(name, unset=NA)
if(is.na(var)){
stop(paste0("cannot find ",name),call. = FALSE)
}
gsub("\"", '',var)
}
# Set the account info for deployment.
setAccountInfo(name = error_on_missing_name("SHINY_ACC_NAME"),
token = error_on_missing_name("TOKEN"),
secret = error_on_missing_name("SECRET"))
# Deploy the application.
deployApp(
appFiles = c("Global.R","ui.R","server.R", "kallisto_tpm_expression_table.txt"),
appName = error_on_missing_name("MASTERNAME"),
appTitle = "Zebrafish Tissue Expression",
forceUpdate = TRUE
)