From 8a8bf85c357fbc3a58ecd54106b1f1945f4f9777 Mon Sep 17 00:00:00 2001 From: Konrad1991 Date: Wed, 18 Dec 2024 13:31:08 +0100 Subject: [PATCH] testing setting environment variable in github workflow directly --- .github/workflows/publish-website.yml | 2 +- app/MainApp.R | 1 + bs/R/MainApp.R | 1 + deploy_serverless_app.R | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index b176c78..9ad1ab9 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -64,7 +64,7 @@ jobs: # Step 5: Export Shiny app as a static website - name: Export Shiny app run: | - Rscript -e 'shinylive::export("./app", "_site")' + Rscript -e ' Sys.setenv(RUN_MODE = "BROWSER"); shinylive::export("./app", "_site")' # Step 6: Upload artifact for deployment - name: Upload Pages artifact diff --git a/app/MainApp.R b/app/MainApp.R index e454257..fcaf541 100644 --- a/app/MainApp.R +++ b/app/MainApp.R @@ -354,6 +354,7 @@ app <- function() { }) output$conditional_data_ui <- renderUI({ + showNotification(Sys.getenv("RUN_MODE"), duration = 0) if (Sys.getenv("RUN_MODE") != "SERVER") { res <- conditionalPanel( condition = "input.conditionedPanels == 'Data'", diff --git a/bs/R/MainApp.R b/bs/R/MainApp.R index e454257..fcaf541 100644 --- a/bs/R/MainApp.R +++ b/bs/R/MainApp.R @@ -354,6 +354,7 @@ app <- function() { }) output$conditional_data_ui <- renderUI({ + showNotification(Sys.getenv("RUN_MODE"), duration = 0) if (Sys.getenv("RUN_MODE") != "SERVER") { res <- conditionalPanel( condition = "input.conditionedPanels == 'Data'", diff --git a/deploy_serverless_app.R b/deploy_serverless_app.R index 23087d8..bf12f5c 100644 --- a/deploy_serverless_app.R +++ b/deploy_serverless_app.R @@ -51,6 +51,8 @@ code <- code[2:(length(code) - 1)] writeLines(code, con) close(con) +stop() + # Build serverless app # ======================================== destination_folder <- "/home/konrad/Documents/Biostats/serverless/"