diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index ea67768..3a0a71d 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -64,6 +64,7 @@ jobs: echo 'DFA_CLIENT_SECRET="${{ secrets.OAUTH_CLIENT_SECRET }}"' >> .Renviron echo 'DFA_DCC_CONFIG="https://raw.githubusercontent.com/Sage-Bionetworks/data_flow_config/dev/tenants.json"' >> .Renviron echo 'GITHUB_PAT="${{ secrets.GITHUB_TOKEN }}"' >> .Renviron + echo 'DFA_REF="${{ github.ref }}"' >> .Renviron # deploy app using rsconnect - name: Authorize and deploy app diff --git a/R/global.R b/R/global.R index 6bdc09c..e93d2e4 100644 --- a/R/global.R +++ b/R/global.R @@ -1,3 +1,15 @@ +## SET GLOBAL VARS + +# READ IN BRANCH NAME +ref <- Sys.getenv("DFA_REF") + +# SET FAVICON URL +FAVICON_URL <- file.path( + "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow", + ref, # FIXME: Automate branch via env variable + "inst/app/www/favicon.ico" +) + # READ IN TENANTS.JSON tenants_config_path <- Sys.getenv("DFA_DCC_CONFIG") if (is.null(tenants_config_path) || nchar(tenants_config_path) == 0) stop("missing DFA_DCC_CONFIG environmental variable") @@ -64,9 +76,3 @@ api <- httr::oauth_endpoint( # The 'openid' scope is required by the protocol for retrieving user information. scope <- "openid view download modify" - -FAVICON_URL <- file.path( - "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow", - "dev", # FIXME: Automate branch via env variable - "inst/app/www/favicon.ico" -) \ No newline at end of file