deploy_app: Deploy a Shiny app to Polished Hosting

View source: R/deploy_app.R

deploy_appR Documentation

Deploy a Shiny app to Polished Hosting

Description

Deploy a Shiny app to Polished Hosting

Usage

deploy_app(
  app_name,
  app_dir = ".",
  api_key = get_api_key(),
  launch_browser = TRUE,
  region = "us-east1",
  ram_gb = 2,
  r_ver = NULL,
  tlmgr = character(0),
  golem_package_name = NULL,
  cache = TRUE,
  gh_pat = NULL,
  max_sessions = Inf
)

Arguments

app_name

Your Shiny app's name.

app_dir

The path to the directory containing your Shiny app.

api_key

Your polished API key. Defaults to Sys.getenv("POLISHED_API_KEY") if set.

launch_browser

Boolean (default: TRUE) - Whether or not to open your newly deployed app in your default web browser after successful deployment.

region

the region to deploy the app to on Google Cloud Platform. See https://cloud.google.com/run/docs/locations for all available regions on Google Cloud Platform. Currently, database connections are only supported for us-east1. See https://polished.tech/docs/06-database-connections for details.

ram_gb

the amount of memory (in GiB) to allocate to your Shiny app's server. Valid values are 2, 4, 8, 16, or 32.

r_ver

Character string of desired R version. If kept as NULL (the default), deploy_app() will detect the R version you are currently running. The R version must be a version supported by an r-ver Docker image. You can see all the r-ver Docker image versions of R here https://github.com/rocker-org/rocker-versioned2/tree/master/dockerfiles and here https://github.com/rocker-org/rocker-versioned/tree/master/r-ver.

tlmgr

a character vector of TeX Live packages to install. This is only used if your Shiny app generates PDF documents. Defaults to character(0) for no TeX Live installation. Provide a character vector of your TeX Live package dependencies to have all your TeX Live packages installed at build time.

golem_package_name

if your Shiny app was created as a package with the golem package, provide the name of the Shiny app package as a character string. Defaults to NULL. Keep as NULL for non golem Shiny apps.

cache

Boolean (default: TRUE) - whether or not to cache the Docker image.

gh_pat

optional GitHub PAT for installing packages from private GitHub repos.

max_sessions

the maximum number of concurrent sessions to run on a single app instance before starting another instance. e.g. set to 5 to have a max of 5 user sessions per app instance. The default is Inf which will run all concurrent sessions on only 1 app instance.

Value

an object of class polished_api_res.

Examples


## Not run: 
deploy_app(
  app_name = "polished_example_01",
  app_dir = system.file("examples/polished_example_01", package = "polished"),
  api_key = "<your polished.tech API key>"
)

## End(Not run)



polished documentation built on Feb. 16, 2023, 8:02 p.m.