Skip to content

Merge pull request #9 from NHS-Transformation-Unit/aw_dev #5

Merge pull request #9 from NHS-Transformation-Unit/aw_dev

Merge pull request #9 from NHS-Transformation-Unit/aw_dev #5

Workflow file for this run

name: Deploy Shiny App to shinyapps.io
on:
push:
branches:
- main # Trigger when code is pushed to main branch
jobs:
deploy:
name: Publish to shinyapps.io
runs-on: ubuntu-latest # Use the latest Ubuntu image
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Set up R environment
- name: Set up R
uses: r-lib/actions/setup-r@v2
# Step 3: Install rsconnect and dependencies
- name: Install rsconnect and dependencies
run: |
R -e 'install.packages("rsconnect")'
# Step 4: Deploy the Shiny app
- name: Deploy app to shinyapps.io
env:
SHINYAPPS_ACCOUNT: ${{ secrets.SHINYAPPS_ACCOUNT }}
SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }}
SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }}
run: |
R -e 'rsconnect::setAccountInfo(name="nhs-tu-andy-wilson", token="${{ secrets.SHINYAPPS_TOKEN }}", secret="${{ secrets.SHINYAPPS_SECRET }}")'
R -e 'rsconnect::deployApp(appDir = ".", appName = "markov_example", forceUpdate = TRUE)'