Hi,
I have a Shiny app that is part of a package. It deploys to shinyapps.io from my local machine using rsconnect::deployApp().
I would like to set up a Github Action workflow that will deploy the app to shinyapps.io on any push to the repo. The main difficulty I have is in storing my shinyapps.io credentials as a secret and then passing that secret to rsconnect::setAccountInfo() within the Github Actions workflow.
My (slightly obscured) failed attempt to do this is as follows. Note that I have a Github secret called RSCONNECT associated with this repo that stores my Shinyapps.io secret.
Ok. I don't use GH actions, just Gitlab CI (with RStudio Connect) which should be similar.
The way I pass secrets there is via an environment variable (+ Sys.getenv in Rscript). So I'd say that if rsconnect_secret is defined, your method should work... or you can try to import it in R using secret=Sys.getenv("rsconnect_secret").
Another alternative in case you want more security than storing the secret in your RStudio environment: secret=keyringr::decrypt_kc_pw("rsconnect_secret")
where "rsconnect_secret" is a password stored in your computer's KeyChain app, assuming you're on Mac. If you're on PC, the analogous function is decrypt_apapi_pw() to be paired with with the Microsoft Data Protection API