Skip to content

Don't use environment variables (#53) #10

Don't use environment variables (#53)

Don't use environment variables (#53) #10

name: deploy-shinyapps
on:
push:
branches: main
paths-ignore:
- 'README.md'
workflow_dispatch:
jobs:
deploy-shiny:
if: github.repository_owner == 'r4ds'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2.2'
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rsconnect
cache-version: 1
- name: Set up .Renviron
run: |
echo "shinyslack_key=${{secrets.SHINYSLACK_KEY}}" >> .Renviron
echo "SLACK_SKIPLOAD=TRUE" >> .Renviron
shell: bash {0}
- name: Push to shinyapps
run: |
rsconnect::setAccountInfo(name='r4dscommunity', token=${{secrets.SHINYAPPS_TOKEN}}, secret=${{secrets.SHINYAPPS_SECRET}})
rsconnect::deployApp(appName = 'shinyslack', forceUpdate = TRUE)
shell: Rscript {0}