diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index 0096ee0..d0819c7 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -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: @@ -26,34 +26,33 @@ 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 @@ -61,7 +60,7 @@ jobs: - 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] @@ -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( @@ -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)