diff --git a/.Rbuildignore b/.Rbuildignore index da9b4c3..762b29e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,7 +12,7 @@ ^inst/WORDLIST$ ^codecov\.yml$ ^docs$ -^docker$ +Dockerfile ^\.github$ ^pkgdown$ ^codemeta\.json$ \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7eaa2e5..773f305 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -18,13 +18,9 @@ jobs: matrix: include: - - dockerfile: docker/Dockerfile - image: dapperstats/shinydocker - image_name: base + - image_name: base tag_prefix: '' - - dockerfile: docker/Dockerfile - image: dapperstats/shinydocker - image_name: app + - image_name: app tag_prefix: app_ runs-on: ubuntu-latest @@ -40,15 +36,19 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - uses: r-lib/actions/setup-pandoc@v2 + - name: Set up pandoc + uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v2 + - name: Set up R from public RSPM + uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 + - name: Install R package and external library dependnencies + uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck needs: check @@ -67,7 +67,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ${{ matrix.image }} + images: dapperstats/shinydocker tags: | type=raw,value=${{ matrix.tag_prefix }}latest type=semver,pattern={{raw}},prefix=${{ matrix.tag_prefix }} @@ -79,18 +79,13 @@ jobs: push: ${{ github.event_name == 'release' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - file: ${{ matrix.dockerfile }} load: true build-args: | "event_sha=${{ github.sha }}" "image_name=${{ matrix.image_name }}" - "SHINY_ACCOUNT=${{ secrets.SHINY_ACCOUNT }}" - "SHINY_TOKEN=${{ secrets.SHINY_TOKEN }}" - "SHINY_SECRET=${{ secrets.SHINY_SECRET }}" - name: Deploy app - if: ${{ matrix.image_name == 'app' }} + if: ${{ matrix.image_name == 'app' }} +# if: ${{ matrix.image_name == 'app' && github.event_name == 'release'}} run: | - docker run --rm dapperstats/shinydocker:app_latest - - + docker run -e "SHINY_ACCOUNT=${{ secrets.SHINY_ACCOUNT }}" -e "SHINY_TOKEN=${{ secrets.SHINY_TOKEN }}" -e "SHINY_SECRET=${{ secrets.SHINY_SECRET }}" --rm dapperstats/shinydocker:app_latest \ No newline at end of file diff --git a/docker/Dockerfile b/Dockerfile similarity index 93% rename from docker/Dockerfile rename to Dockerfile index e2b67b9..b7ad9de 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -21,9 +21,9 @@ ARG SHINY_ACCOUNT "" ARG SHINY_TOKEN "" ARG SHINY_SECRET "" -ENV SHINY_ACCOUNT=$SHINY_ACCOUNT -ENV SHINY_TOKEN=$SHINY_TOKEN -ENV SHINY_SECRET=$SHINY_SECRET +ENV SHINY_ACCOUNT="" +ENV SHINY_TOKEN="" +ENV SHINY_SECRET="" diff --git a/R/webapp.R b/R/webapp.R index 49828f7..b34acfd 100644 --- a/R/webapp.R +++ b/R/webapp.R @@ -37,7 +37,10 @@ deploy_app <- function(main = ".") { secret = Sys.getenv("SHINY_SECRET"), server = "shinyapps.io") - deployApp(appDir = app_path(main = main), forceUpdate = TRUE, appName = "ShinyDocker") + deployApp(appDir = app_path(main = main), + appFiles = "..", + forceUpdate = TRUE, + appName = "ShinyDocker") } diff --git a/R/webapp_server.R b/R/webapp_server.R index b494231..ccda5f7 100644 --- a/R/webapp_server.R +++ b/R/webapp_server.R @@ -36,6 +36,11 @@ app_server <- function (input, output <- initial_output(rv = rv, output = output) +messageq(break_lines(5)) +print(list.files()) +messageq(break_lines()) +print(list.files("..")) + } diff --git a/R/webapp_ui.R b/R/webapp_ui.R index 01c1d0d..2e6252b 100644 --- a/R/webapp_ui.R +++ b/R/webapp_ui.R @@ -26,7 +26,7 @@ NULL #' app_ui <- function ( ) { - fluidPage(titlePanel("Hi how are you?"), + fluidPage(titlePanel("Hi, how are you?"), title = "ShinyDocker", theme = app_theme( )) diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index a4ef086..0000000 --- a/docker/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# `ShinyDocker` - -[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/dapperstats/ShinyDocker/main/LICENSE) -[![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) - - -Images are built using the `Docker` GitHub Action \ No newline at end of file diff --git a/inst/app/global.R b/inst/app/global.R index 67bdc38..3ae89ec 100644 --- a/inst/app/global.R +++ b/inst/app/global.R @@ -6,7 +6,6 @@ if (main_exists) { main <- ".." - onStop(function( ) { rm(main, inherits = TRUE) if (main_exists) {