Skip to content

Commit

Permalink
upgrade renv version in deployment yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
lakikowolfe committed Sep 13, 2023
1 parent 1a6ba3c commit 5298050
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/shinyapps_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ on:
- v[0-9]+.[0-9]+.[0-9]+

paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '**/*.md'
- '**/.gitignore'
- ".github/ISSUE_TEMPLATE/**"
- "**/*.md"
- "**/.gitignore"

jobs:
shiny-deploy:
Expand All @@ -26,42 +26,41 @@ jobs:
SCHEMATIC_URL_STAGING: https://schematic-staging.api.sagebionetworks.org
SCHEMATIC_URL_PROD: https://schematic.api.sagebionetworks.org
# This should not be necessary for installing from public repo's however remotes::install_github() fails without it.
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y pip libcurl4-openssl-dev libpng-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libtiff-dev libxml2-dev
# this action checks out the $GITHUB_WORKSPACE repository so that the workflow can access it
- uses: actions/checkout@v3

# this action sets up pandoc
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: 'renv'
r-version: "renv"

# install packages
- name: Install rsconnect
- name: Install renv and rsconnect
run: |
install.packages("renv")
renv::upgrade(version = "0.17.3")
renv::upgrade(version = "1.0.2")
renv::install("rsconnect@0.8.29")
shell: Rscript {0}

# this action activates renv
- uses: r-lib/actions/setup-renv@v2

# deploy app using rsconnect
- name: Authorize and deploy app
run: |
renv::restore(packages = "renv")
refName <- Sys.getenv("GITHUB_REF_NAME")
repo <- Sys.getenv("GITHUB_REPOSITORY")
appName <- strsplit(repo, "/")[[1]][2]
Expand Down Expand Up @@ -92,13 +91,13 @@ jobs:
rsConnectUser <-"${{ secrets.RSCONNECT_USER }}"
rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}"
rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}"
# create config file
config <- "client_id: ${{ secrets.OAUTH_CLIENT_ID }}"
config <- c(config, "client_secret: ${{ secrets.OAUTH_CLIENT_SECRET }}")
appUrl<- sprintf("https://%s.shinyapps.io/%s", rsConnectUser, appName)
config <- c(config, sprintf("app_url: %s", appUrl))
# write config file
configFileConn<-file("oauth_config.yml")
tryCatch(
Expand All @@ -108,11 +107,11 @@ jobs:
# set account info
rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret)
# get app names. If app exists, configure then deploy. Otherwise
# deploy then configure.
apps <- rsconnect::applications()$name
if (appName %in% apps) {
rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose")
rsconnect::deployApp(appName = appName)
Expand Down

0 comments on commit 5298050

Please sign in to comment.