diff --git a/.Rbuildignore b/.Rbuildignore index a7a8699..1971e5e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ hoad.code-workspace ^R/.scoap\.R$ ^R/.unpaywall_integration\.R$ .vscode +.azure diff --git a/.dockerignore b/.dockerignore index 9226438..03ea293 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ !/NAMESPACE !/LICENSE.md !/.Rbuildignore +!/.azure/init.sh diff --git a/.github/newsletter.md b/.github/newsletter.md index ee3cbcf..2f5235e 100644 --- a/.github/newsletter.md +++ b/.github/newsletter.md @@ -1,6 +1,6 @@ # Newsletter abonnieren -In unserem deutschsprachigen Newsletter informieren wir Sie über neue Entwicklungen und Veranstaltungen rund um das Projekt. +In unserem deutschsprachigen Newsletter `hoad@sub.uni-goettingen.de` informieren wir Sie über neue Entwicklungen und Veranstaltungen rund um das Projekt.
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c856fb5..cf5178e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,5 +1,4 @@ -on: - push: +on: push jobs: CICD: @@ -8,8 +7,11 @@ jobs: run: shell: Rscript {0} container: - # this needs to be the same as in Dockerfile - image: subugoe/muggle-onbuild:f60004c31979947dab53fbf9cfbb0e7f1c4bea55 + # update muggle here and in Dockerfile + image: subugoe/muggle-buildtime-onbuild:9ee02c2d9b32cab07681288de9995dc3d4124e4d + env: + MUGGLE_PKG_NAME: ${{ github.event.repository.name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Cache R Packages @@ -23,10 +25,11 @@ jobs: - name: Install R Dependencies env: # see builder.Dockerfile for explanation, this resets after this step - R_LIBS_SITE: $R_LIBS_APP_GH + R_LIBS_SITE: $R_LIBS_RUNTIME_GH run: remotes::install_deps(dependencies = TRUE) - name: Check - run: muggle::rcmdcheck2() + # TODO error out on all but note again https://github.com/subugoe/hoad/issues/194 + run: devtools::check(error_on = "error") - name: Test Coverage run: covr::codecov() - name: Build Package Website @@ -34,10 +37,11 @@ jobs: # extra step is necessary to build index.md to integrate readme and landing page rmarkdown::render("pkgdown/index.Rmd") pkgdown::build_site(override = list(new_process = FALSE)) - - uses: docker/build-push-action@v1 - name: Build Dev Image + - name: Build Buildtime Image + uses: docker/build-push-action@v1 with: - repository: ${{ github.repository }}/hoad-dev + repository: ${{ github.repository }}/${{ env.MUGGLE_PKG_NAME }}-buildtime + target: buildtime username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com @@ -48,29 +52,37 @@ jobs: tags: ${{ github.sha }} add_git_labels: true push: ${{ github.event_name != 'pull_request' }} - - name: Setup GCP Cloud SDK - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master + - name: Build Runtime Image + uses: docker/build-push-action@v1 with: - project_id: ${{ secrets.GCP_PROJECT_ID }} - service_account_key: ${{ secrets.GCP_SA_KEY }} - export_default_credentials: true - - run: gcloud info - shell: bash - - name: Deploy Shiny Application to shinyapps.io ref - env: - SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }} - SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }} - GITHUB_REF: ${{ github.ref }} - if: github.event_name != 'pull_request' + repository: ${{ github.repository }}/${{ env.MUGGLE_PKG_NAME }}-runtime + target: runtime + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + # this will set "latest" if master as per https://github.com/docker/build-push-action + tag_with_ref: true + # we're relying on long shas only to keep things easy + tag_with_sha: false + tags: ${{ github.sha }} + add_git_labels: true + push: ${{ github.event_name != 'pull_request' }} + - name: Log in to Azure + uses: azure/login@v1.1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Deploy to Azure Webapps run: | - remotes::install_github(repo = "subugoe/hoad", ref = "master", force = TRUE, dependencies = TRUE) - rsconnect::setAccountInfo(name = 'subugoe', token = Sys.getenv('SHINYAPPS_TOKEN'), secret = Sys.getenv('SHINYAPPS_SECRET')) - app_name <- paste0("hoad-", gsub("/", "-", Sys.getenv('GITHUB_REF'))) - rsconnect::deployDoc(doc = "inst/app/dashboard.Rmd", appName = app_name) - shell: Rscript {0} + muggle::az_webapp_config_muggle( + plan = "hoad", + resource_group = "hoad", + subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc", + restart = TRUE + ) - name: Deploy to GitHub Pages if: github.ref == 'refs/heads/master' uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Sleep to let GITHUB_TOKEN persist + run: Sys.sleep(240) diff --git a/DESCRIPTION b/DESCRIPTION index c8dfe49..178fa86 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -62,20 +62,20 @@ Suggests: DT, writexl, echarts4r, - metar, DBI, dbplyr, haven, lubridate, modelr, reprex, - rsconnect, rvest, selectr, httr, purrr, covr, - testthat + testthat, + subugoetheme, + shinycaas URL: https://subugoe.github.io/hoad, https://github.com/subugoe/hoad/ BugReports: https://github.com/subugoe/hoad/issues RoxygenNote: 7.1.1 @@ -88,4 +88,5 @@ Imports: ggplot2, rlang Remotes: - subugoe/metar@7ccc2a0 + subugoe/subugoetheme@1.0.0, + subugoe/shinycaas@31684600b286d5da5639a430a4b83a04de36bd34 diff --git a/Dockerfile b/Dockerfile index 5ea4d89..bbceab6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,4 @@ -FROM subugoe/muggle-onbuild:f60004c31979947dab53fbf9cfbb0e7f1c4bea55 +ARG MUGGLE_TAG=9ee02c2d9b32cab07681288de9995dc3d4124e4d +FROM subugoe/muggle-buildtime-onbuild:${MUGGLE_TAG} as buildtime +FROM subugoe/muggle-runtime-onbuild:${MUGGLE_TAG} as runtime +CMD shinycaas::az_webapp_shiny_opts(); hoad::runHOAD() diff --git a/R/plots.R b/R/plots.R index b8d9f84..cae5241 100644 --- a/R/plots.R +++ b/R/plots.R @@ -1,5 +1,5 @@ #' Color palettes -#' Colors used in the hybrid open access dashboard, based on [metar::ugoe_pal()] +#' Colors used in the hybrid open access dashboard, based on [subugoetheme::ugoe_pal()] #' @family visualisation functions #' @name colors NULL diff --git a/hoad.code-workspace b/hoad.code-workspace deleted file mode 100644 index 5709732..0000000 --- a/hoad.code-workspace +++ /dev/null @@ -1,8 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": {} -} diff --git a/inst/app/dashboard.Rmd b/inst/app/dashboard.Rmd index 9017d63..f9be5e0 100644 --- a/inst/app/dashboard.Rmd +++ b/inst/app/dashboard.Rmd @@ -4,7 +4,7 @@ output: flexdashboard::flex_dashboard: orientation: rows vertical_layout: fill - css: !expr metar::subugoe_template()$assets$css + css: !expr subugoetheme::pkgdown_template()$assets$css runtime: shiny --- @@ -124,7 +124,7 @@ hybrid_sub <- reactive({ # }) ``` -Notice that only those hybrid open access journals were included where +Notice we here only include those hybrid open access journals were included where academic institutions sponsored the open access publication according to the [Open APC initiative](https://github.com/openapc/openapc-de) and where publishers shared license information about immediate open access with [Crossref](https://github.com/CrossRef/rest-api-doc). diff --git a/man/colors.Rd b/man/colors.Rd index c84793a..809110c 100644 --- a/man/colors.Rd +++ b/man/colors.Rd @@ -7,7 +7,7 @@ \alias{colors_license_unpaywall} \alias{colors_source_disclosure} \title{Color palettes -Colors used in the hybrid open access dashboard, based on \code{\link[metar:ugoe_pal]{metar::ugoe_pal()}}} +Colors used in the hybrid open access dashboard, based on \code{\link[subugoetheme:ugoe_pal]{subugoetheme::ugoe_pal()}}} \format{ An object of class \code{character} of length 6. @@ -24,7 +24,7 @@ colors_source_disclosure } \description{ Color palettes -Colors used in the hybrid open access dashboard, based on \code{\link[metar:ugoe_pal]{metar::ugoe_pal()}} +Colors used in the hybrid open access dashboard, based on \code{\link[subugoetheme:ugoe_pal]{subugoetheme::ugoe_pal()}} } \section{Functions}{ \itemize{ diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 0acde19..c8f472c 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -1,3 +1,4 @@ +url: https://subugoe.github.io/hoad/ authors: Najko Jahn: href: https://www.sub.uni-goettingen.de/kontakt/personen-a-z/personendetails/person/najko-jahn/ @@ -17,7 +18,7 @@ authors: href: https://github.com/openapc html: template: - package: metar + package: subugoetheme opengraph: twitter: site: "@subugoe" diff --git a/vignettes/interactive.Rmd b/vignettes/interactive.Rmd index 57a2213..f32617f 100644 --- a/vignettes/interactive.Rmd +++ b/vignettes/interactive.Rmd @@ -2,33 +2,6 @@ title: "Interactive Dashboard" --- - - - - - -
- -
+```{r echo=FALSE} +shinycaas::include_app2("https://hoad.azurewebsites.net") +```