Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
simonliao98 authored Oct 26, 2024
1 parent 974e02f commit bde7fdd
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Deploy to shinyapps.io
on:

# run on any push
push:

# run on request (via button in actions menu)
workflow_dispatch:

jobs:
deploy:
name: Deploy to shinyapps

# allow skipping deployment for commits containing '[automated]' or '[no-deploy]' in the commit message
if: "!contains(github.event.head_commit.message, '[automated]') && !contains(github.event.head_commit.message, '[no-deploy]')"
runs-on: ubuntu-latest
steps:
# Step 1: Check out the code from the repository
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2-branch

# Step 2: Install the required Debian packages
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y librsvg2-dev
sudo apt install cmake
# Step 3: Verify that pkg-config can find the libraries
- name: Verify pkg-config for librsvg
run: |
pkg-config --modversion librsvg-2.0
# Step 4: Cache R packages
- name: Cache R packages
uses: actions/cache@v3
with:
path: ~/.R/library
key: ${{ runner.os }}-R-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-R-
# Step 5: Install R packages
- name: Install shiny
run: |
install.packages(c("shiny",
"renv",
"rsconnect",
"rsvg",
"shinycssloaders",
"tidyverse",
"svglite",
"plotly",
"ggcorrplot",
"DT",
"broom",
"ggpp",
"ggpubr",
"gridExtra",
"grid",
"foreach",
"shinyjs",
"lubridate",
"emojifont",
"showtext",
"patchwork",
"IRkernel"))
shell: Rscript {0}

# Step 6: Deploy to shinyapps.io
- name: Push to shiny.io
run: |
"rsconnect::setAccountInfo(name='easyeyes', token=${{secrets.TOKEN}}, secret=${{secrets.SECRET}})"
"rsconnect::deployApp(appName = 'easyeyes_app')"
shell: Rscript {0}

0 comments on commit bde7fdd

Please sign in to comment.