Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShinyApps deployment #48

Merged
merged 29 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b3fa4eb
cleanup
brucehoff Nov 7, 2022
1d59b98
update BioC
brucehoff Nov 7, 2022
2535642
update BioC dependencies
brucehoff Nov 7, 2022
e260656
install rsconnect
brucehoff Nov 7, 2022
acb53ae
install rsconnect
brucehoff Nov 7, 2022
9a245eb
removed BioC packages from renv.lock
brucehoff Nov 7, 2022
b2515a1
added renv::isolate()
brucehoff Nov 27, 2022
a394051
delete .Rprofile to avoid restarting renv after deployment
brucehoff Nov 27, 2022
998a76a
moved rsconnect installation
brucehoff Nov 27, 2022
6cc4648
update version of openssl to 2.0.0
brucehoff Nov 27, 2022
d5c895f
deploy folders
brucehoff Nov 27, 2022
ccf521b
list installed packages
brucehoff Nov 27, 2022
90d608a
disable renv
brucehoff Dec 10, 2022
77da5f5
disable renv
brucehoff Dec 10, 2022
affec4a
install BiocManager
brucehoff Dec 10, 2022
4c02582
try different R package repo'
brucehoff Dec 11, 2022
1ed7462
set up repo' for deploy app step
brucehoff Dec 11, 2022
498e340
install missing dependencies
brucehoff Dec 11, 2022
ffc69b8
install 'markdown' package
brucehoff Dec 11, 2022
8214f6e
debugging missing markdown package
brucehoff Dec 12, 2022
8ac87cf
remove unneeded changes
brucehoff Dec 12, 2022
9cf32f2
remove .Rprofile to disable renv for the ShinyApps build
brucehoff Dec 12, 2022
b0d931d
install 'markdown' on app startup
brucehoff Dec 16, 2022
2a0e549
use dependencies=TRUE in install.packages
brucehoff Dec 16, 2022
1f28e29
try adding markdown to DESCRIPTION
brucehoff Dec 18, 2022
39050ea
add all packages to 'Imports' list
brucehoff Dec 18, 2022
9f3bd68
add missing packages
brucehoff Dec 19, 2022
8c3616f
remove empty line from DESCRIPTION file
brucehoff Dec 19, 2022
5038d81
clean up and deployment instructions
brucehoff Dec 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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