Skip to content

Commit

Permalink
Merge pull request #48 from brucehoff/develop
Browse files Browse the repository at this point in the history
ShinyApps deployment
  • Loading branch information
allaway authored Dec 19, 2022
2 parents ea68fe3 + 5038d81 commit 30ee63f
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 23 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

name: shiny-deploy

env:
RENV_PATHS_ROOT: ~/.local/share/renv

on:
push:
branches:
- develop
- IT-828
- release*

jobs:
Expand All @@ -26,24 +22,28 @@ jobs:
sudo apt-get install -y libcurl4-openssl-dev gdal-bin libgdal-dev default-jdk
- uses: actions/checkout@v2

- name: Cache packages
uses: actions/cache@v1
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-

- name: disable renv
run: rm .Rprofile

- name: Restore packages
- name: Install packages
shell: sudo Rscript {0} # running this step as 'sudo' is necessary to be able to install packages in default library
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
options(repos = c(RSPM = "https://packagemanager.rstudio.com/all/latest"))
renv::restore()
options(repos = 'http://cran.fhcrc.org')
install.packages('BiocManager', dependencies=TRUE)
options(repos = c(BiocManager::repositories(), getOption("repos")))
install.packages(c("shiny","golem","processx","attempt","DT","glue","htmltools",
"ggplot2","plotly","shinydashboard","readr","shinycssloaders","wrapr","forcats",
"scales","ggridges","maftools","pkgload","waiter","dr4pl","rsconnect", "brio", "callr",
"diffobj", "praise", "rematch2", "markdown", "rmarkdown", "testthat", "tinytex", "waldo",
"TSP", "anytime", "ca", "egg", "gclus", "heatmaply", "qap", "seriation", "shinyWidgets"),
dependencies=TRUE)

- name: Deploy app
run: |
options(repos = c(BiocManager::repositories(), 'http://cran.fhcrc.org', getOption("repos")))
branch<-Sys.getenv("GITHUB_REF_NAME")
repo<-Sys.getenv("GITHUB_REPOSITORY")
appName<-strsplit(repo, "/")[[1]][2]
Expand All @@ -54,9 +54,7 @@ jobs:
rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}"
rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}"
rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret)
# omit archive/ folder from the collection to be deployed
# (Tried using .rcsignore file but it did not work as documented.)
appFiles<-dir()[which(dir()!="archive")]
appFiles<-dir()[which(dir()!="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}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.RData
.Ruserdata
.DS_Store
.project
135 changes: 132 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,141 @@ Imports:
pkgload,
waiter,
dr4pl,
rsconnect
rsconnect,
MASS,
Matrix,
R6,
RColorBrewer,
Rcpp,Rdpack,
Rhtslib,
TSP,
askpass,
assertthat,
base64enc,
bit,
bit64,
brew,
brio,
bslib,
cachem,
callr,
cli,
clipr,
cluster,
codetools,
colorspace,
commonmark,
config,
cpp11,
crayon,
credentials,
crosstalk,
curl,
data.table,
dendextend,
desc,
diffobj,
digest,
dockerfiler,
dplyr,
egg,
ellipsis,
evaluate,
fansi,
farver,
fastmap,
fontawesome,
foreach,fs,
gclus,
generics,
gert,
gh,
gitcreds,
gridExtra,
gtable,
heatmaply,
here,
highr,
hms,
htmlwidgets,
httpuv,
httr,
ini,
isoband,
iterators,
jquerylib,
jsonlite,
knitr,
labeling,
later,
lattice,
lazyeval,
lifecycle,
magrittr,
markdown,
mgcv,
mime,
munsell,
nlme,
openssl,
packrat,
pillar,
pkgbuild,
pkgconfig,
plyr,
praise,
prettyunits,
progress,
promises,
ps,
purrr,
qap,
rappdirs,
rbibutils,
registry,
rematch2,
remotes,
renv,
reshape2,
rlang,
rmarkdown,
roxygen2,
rprojroot,
rstudioapi,
sass,
seriation,
shinyWidgets,
sourcetools,
stringr,
survival,
sys,
tensor,
testthat,
tibble,
tidyr,
tidyselect,
tinytex,
tzdb,
usethis,
utf8,
vctrs,
viridis,
viridisLite,
vroom,
waldo,
webshot,
whisker,
withr,
xfun,
xml2,
xtable,
yaml,
zip,
zlibbioc
RoxygenNote: 7.1.2
Suggests:
testthat (>= 2.1.0),
knitr,
rmarkdown
knitr
VignetteBuilder: knitr
URL: https://github.com/allaway/kairos
BugReports: https://github.com/allaway/kairos/issues
Expand Down
10 changes: 10 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ You can install the latest version of kairos from with:
devtools::install_github("nf-osi/kairos")
```

## Deployment to ShinyApps

- Enable workflows in the GitHub repository
- Under [secrets](https://github.com/nf-osi/kairos/settings/secrets/actions) click 'New repository secret'
- Enter secrets for `RSCONNECT_USER`, `RSCONNECT_TOKEN`, and `RSCONNECT_SECRET`, the values for which are saved in Sage's LastPass.
- Trigger the GitHub action.
- Check out the app here: https://sagebio.shinyapps.io/kairos-staging.
- After verifying correctness, create a Git branch named release*, e.g., `release-1.0`.
- The application will become available at https://sagebio.shinyapps.io/kairos

0 comments on commit 30ee63f

Please sign in to comment.