Skip to content

Commit

Permalink
Merge pull request #10 from flor14/update-2023
Browse files Browse the repository at this point in the history
Update 2023
  • Loading branch information
flor14 committed Nov 14, 2023
2 parents ab8771a + e1359bc commit 418678f
Show file tree
Hide file tree
Showing 9 changed files with 2,243 additions and 264 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy-app.yaml
@@ -0,0 +1,38 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]

name: shiny-deploy

jobs:
shiny-deploy:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2

- name: Install rsconnect
run: install.packages("rsconnect")
shell: Rscript {0}

- name: Authorize and deploy app
env:
# Provide your app name, account name, and server to be deployed below
APPNAME: feederwatch_app
ACCOUNT: flor
SERVER: shinyapps.io # server to deploy
run: |
rsconnect::setAccountInfo("${{ secrets.RSCONNECT_USER }}", "${{ secrets.RSCONNECT_TOKEN }}", "${{ secrets.RSCONNECT_SECRET }}")
rsconnect::deployApp(appName = "${{ env.APPNAME }}", account = "${{ env.ACCOUNT }}", server = "${{ env.SERVER }}")
shell: Rscript {0}
101 changes: 0 additions & 101 deletions .github/workflows/run-tests.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions Dockerfile
@@ -0,0 +1,33 @@
FROM rocker/r-base:4.2.1

# complete Linux packages with dockerfiler
RUN apt-get update && apt-get install -y --no-install-recommends \
libicu-dev \
libpng-dev \
make \
pandoc \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --system app \
&& adduser --system --ingroup app app

WORKDIR /home/shiny-app

COPY . .

RUN chown app:app -R /home/shiny-app

USER app

# Initialize new renv project
RUN R -e "renv::init()"

# Restore project dependencies
RUN R -e "renv::restore()"

# Expose port
EXPOSE 3838

# Run command to start Shiny in the container
CMD ["R", "-e", "shiny::runApp('/home/shiny-app', port = 3838, host = '0.0.0.0')"]

0 comments on commit 418678f

Please sign in to comment.