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

add branch name to renviron #239

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/shinyapps_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 12 additions & 6 deletions R/global.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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"
)