-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action to deploy gallery apps
- Loading branch information
Gordon Shotwell
committed
Aug 1, 2023
1 parent
d1290be
commit 246d475
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |