Skip to content

fix(snic): normalize canvas_size to c(width, height) convention #244

fix(snic): normalize canvas_size to c(width, height) convention

fix(snic): normalize canvas_size to c(width, height) convention #244

Workflow file for this run

name: Deploy Shiny App to shinyapps.io
on:
push:
branches:
- main
workflow_dispatch: # Allow manual triggering
permissions:
contents: read
# CRITICAL: Prevent concurrent deployments to shinyapps.io
# Without this, rapid commits cause HTTP 409 errors ("tasks already in progress")
concurrency:
group: shinyapps-deployment
cancel-in-progress: false # Queue deployments instead of canceling
jobs:
deploy:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
use-public-rspm: false # Disable RSPM to use standard CRAN
- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rsconnect
# Deploy with automatic retry for transient errors (HTTP 409, timeouts)
- name: Deploy to shinyapps.io
uses: nick-fields/retry@v3
with:
timeout_minutes: 90
max_attempts: 3
retry_wait_seconds: 300 # 5 min wait between retries
warning_on_retry: true
command: Rscript inst/shiny-app/deploy.R
env:
SHINYAPPS_ACCOUNT: ${{ secrets.SHINYAPPS_ACCOUNT }}
SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }}
SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }}
# Wait for shinyapps.io to finalize deployment before allowing next run
- name: Post-deployment stabilization
if: success()
run: |
echo "Waiting for shinyapps.io to finalize deployment..."
sleep 30