Skip to content

Commit

Permalink
Add github action to deploy gallery apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Shotwell committed Aug 1, 2023
1 parent d1290be commit 246d475
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy-gallery-apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Shiny Apps

on:
push:
branches:
- auto-deploy-gallery

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install rsconnect
run: pip install rsconnect-python

- name: Deploy Shiny Apps
run: |
# Function to deploy the Shiny application
deploy_shiny_app() {
local app_name=$1
rsconnect deploy shiny "$app_name" -T $TOKEN -S $SECRET
}
# Loop through the contents of the examples folder
for app_path in examples/*; do
if [ -d "$app_path" ]; then
app_name=$(basename "$app_path")
deploy_shiny_app "$app_name"
fi
done
env:
TOKEN: ${{secrets.SHINYAPPS_DEPLOY_TOKEN}}
SECRET: ${{secrets.SHINYAPPS_DEPLOY_SECRET}}

0 comments on commit 246d475

Please sign in to comment.