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

Fix deployment action to ShinyApps #63

Merged
merged 11 commits into from
Feb 13, 2024
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ $run_dev.*
^README\.Rmd$
^LICENSE\.md$
^\.github$
^app\.R$
^rsconnect$
7 changes: 5 additions & 2 deletions .github/workflows/shiny-deploy-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
with:
use-public-rspm: true

- name: Install libgit2-dev
run: sudo apt-get install -y libgit2-dev

- uses: r-lib/actions/setup-renv@v2

- name: Install rsconnect
Expand All @@ -31,9 +34,9 @@ jobs:
env:
# Provide your app name, account name, and server to be deployed below
APPNAME: ordinalsimr
# ACCOUNT: your-account-name
ACCOUNT: 6fcd1k-pat
SERVER: shinyapps.io # server to deploy
run: |
rsconnect::setAccountInfo("${{ secrets.RSCONNECT_USER }}", "${{ secrets.RSCONNECT_TOKEN }}", "${{ secrets.RSCONNECT_SECRET }}")
rsconnect::deployApp(appName = "${{ env.APPNAME }}", account = "${{ env.ACCOUNT }}", server = "${{ env.SERVER }}")
rsconnect::deployApp(appName = "${{ env.APPNAME }}", account = "${{ env.ACCOUNT }}", server = "${{ env.SERVER }}", forceUpdate = TRUE)
shell: Rscript {0}
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Imports:
glue,
golem (>= 0.4.0),
magrittr,
pkgload,
purrr,
rhandsontable,
rlang,
Expand Down
3 changes: 3 additions & 0 deletions R/_disable_autoload.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Disabling shiny autoload

# See ?shiny::loadSupport for more information
1 change: 0 additions & 1 deletion R/mod_save_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mod_save_data_server <- function(id, input_data, processed_data, input, output,
# shinyFileSave(input, "save_results", roots = "home")

data_to_save <- reactive({
browser()
list(
comparison_data = format_simulation_data(input_data$comparison_results()) %>%
append(list(distribution_statistics = processed_data$distribution_statistics(),
Expand Down
7 changes: 7 additions & 0 deletions app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Launch the ShinyApp (Do not remove this comment)
# To deploy, run: rsconnect::deployApp()
# Or use the blue button on top of this file

pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE)
options( "golem.app.prod" = TRUE)
ordinalsimr::run_app() # add parameters here (if any)
12 changes: 6 additions & 6 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1644,14 +1644,14 @@
},
"rlang": {
"Package": "rlang",
"Version": "1.1.1",
"Version": "1.1.3",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Requirements": [
"R",
"utils"
],
"Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb"
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
},
"rmarkdown": {
"Package": "rmarkdown",
Expand Down Expand Up @@ -1756,9 +1756,9 @@
},
"rsconnect": {
"Package": "rsconnect",
"Version": "1.1.0",
"Version": "1.2.1",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
Expand All @@ -1774,7 +1774,7 @@
"tools",
"yaml"
],
"Hash": "ec53d658cf0abbd7cd7ce2d6b9d70337"
"Hash": "94bb3a2125b01b13dd2e4a784c2a9639"
},
"rstudioapi": {
"Package": "rstudioapi",
Expand Down