diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4244477 --- /dev/null +++ b/.github/workflows/main.yml @@ -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} +