Skip to content

Fix shinyapps deploy: avoid RSPM manifest URLs (use CRAN for CI + rep… #13

Fix shinyapps deploy: avoid RSPM manifest URLs (use CRAN for CI + rep…

Fix shinyapps deploy: avoid RSPM manifest URLs (use CRAN for CI + rep… #13

# Deploy Shiny app to https://www.shinyapps.io/ on every push to main.
#
# One-time setup: add these repository secrets
# (Settings → Secrets and variables → Actions → New repository secret):
#
# SHINYAPPS_ACCOUNT — shinyapps.io username (e.g. nathankim)
# SHINYAPPS_TOKEN — from https://www.shinyapps.io/admin/#/tokens
# SHINYAPPS_SECRET — shown once when you create the token
#
# Optional:
# SHINYAPPS_APP_NAME — defaults to investment-performance-tracker
#
# See .github/DEPLOY_SHINYAPPS.md for more detail.
name: Deploy to shinyapps.io
# Speed: skip this workflow when only docs/README/etc. change (saves ~5–15+ min per push).
# Full deploy still available anytime via Actions → Run workflow.
on:
push:
branches: [main]
paths:
- "app.R"
- "R/**"
- "scripts/deploy_shinyapps.R"
- "DESCRIPTION"
- ".github/workflows/deploy-shinyapps.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
SHINYAPPS_ACCOUNT: ${{ secrets.SHINYAPPS_ACCOUNT }}
SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }}
SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }}
SHINYAPPS_APP_NAME: ${{ secrets.SHINYAPPS_APP_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: release
# Do not use RSPM here: rsconnect can record repos as "RSPM" in the bundle
# manifest, and shinyapps.io's image builder fails with:
# Unsupported url scheme: RSPM/src/contrib/...
use-public-rspm: false
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
# upgrade must be a valid R expression (e.g. FALSE). YAML "false" becomes lowercase
# and breaks: upgrade = (false) → Error: object 'false' not found
extra-packages: |
any::rsconnect
any::cpp11
any::RcppArmadillo
- name: Deploy
run: Rscript scripts/deploy_shinyapps.R