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.
on: [push, pull_request]
name: deploy-shiny
jobs:
deploy-shiny:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
- name: Install shiny
run: |
install.packages(c("shiny", "rsconnect"), type = "binary")
shell: Rscript {0}
- name: shinyapps credentials
with:
rsconnect_secret: ${{ secrets.RSCONNECT }}
run: Rscript -e 'rsconnect::setAccountInfo(name="myusername", token="tokengoeshere", secret="$rsconnect_secret")'
shell: Rscript {0}