Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update global.R #2

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
^inst/WORDLIST$
^codecov\.yml$
^docs$
^docker$
Dockerfile
^\.github$
^pkgdown$
^codemeta\.json$
33 changes: 14 additions & 19 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
6 changes: 3 additions & 3 deletions docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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=""



Expand Down
5 changes: 4 additions & 1 deletion R/webapp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}

Expand Down
5 changes: 5 additions & 0 deletions R/webapp_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(".."))

}


Expand Down
2 changes: 1 addition & 1 deletion R/webapp_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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( ))

Expand Down
7 changes: 0 additions & 7 deletions docker/README.md

This file was deleted.

1 change: 0 additions & 1 deletion inst/app/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if (main_exists) {

main <- ".."


onStop(function( ) {
rm(main, inherits = TRUE)
if (main_exists) {
Expand Down