-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (44 loc) · 2.12 KB
/
shinyapps_deploy.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
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
name: shiny-deploy
on:
push:
branches:
- develop
- release*
jobs:
shiny-deploy:
runs-on: ubuntu-latest
steps:
- name: Install System Dependencies
run: |
sudo apt-get update
# The rsconnect R package needs cUrl. This app needs the Java JDK (runtime AND compiler).
sudo apt-get install -y libcurl4-openssl-dev default-jdk
- uses: actions/checkout@v2
- name: Install R packages
run: |
options(repos = 'http://cran.fhcrc.org')
# This list of packages came from global.R. Also we need rsconnect to deploy the app'
install.packages(c("DT", "png", "rJava", "rcdk", "fingerprint", "enrichR",
"webchem", "plyr", "dplyr", "tidyr", "purrr", "tibble", "plotly", "shinyBS", "shinythemes",
"visNetwork", "igraph", "shinyjs", "shinycssloaders", "XML", "rsconnect", "renv", "conflicted",'rjson', 'callr'))
# running this step as 'sudo' is necessary to be able to install packages in default library
shell: sudo Rscript {0}
- name: Deploy app
run: |
branch<-Sys.getenv("GITHUB_REF_NAME")
repo<-Sys.getenv("GITHUB_REPOSITORY")
appName<-strsplit(repo, "/")[[1]][2]
if (!startsWith(branch, "release")) {
appName = paste(appName, "staging", sep="-")
}
rsConnectUser <-"${{ secrets.RSCONNECT_USER }}"
rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}"
rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}"
rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret)
# omit renv/ folder from the collection to be deployed
appFiles<-dir(all.files=T,no..=T)[which(dir(all.files=T,no..=T)!="renv")]
rsconnect::deployApp(appName = appName, appFiles=appFiles)
# important NOT to run this step as sudo, otherwise env var's will be missing
shell: Rscript {0}