Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

deploy to azure #270

Draft
wants to merge 47 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
824f563
login to az
maxheld83 Jul 15, 2020
0e49856
first install az
maxheld83 Jul 15, 2020
1cb456c
auth in separate job
maxheld83 Jul 15, 2020
4cea5a9
also deploy
maxheld83 Jul 15, 2020
cbefae3
first log in to github pkg registry
maxheld83 Jul 15, 2020
4856123
poke ghactions
maxheld83 Jul 15, 2020
d5d0644
fix yaml
maxheld83 Jul 16, 2020
5a9e368
fix tag
maxheld83 Jul 16, 2020
5e60c15
set entrypoint and pkg.github.com creds #245
maxheld83 Jul 16, 2020
13efdcc
just update app settings #245
maxheld83 Jul 16, 2020
00ba9ab
fix image name
maxheld83 Jul 16, 2020
2385b72
try out deploy
maxheld83 Jul 16, 2020
d80acb7
add init.sh for azure #245
maxheld83 Jul 17, 2020
6b4f5c5
auth against azure
maxheld83 Jul 20, 2020
b2cb999
deploy to azure programmatically #245
maxheld83 Jul 20, 2020
dc1af99
checkout for azure #245
maxheld83 Jul 20, 2020
362d168
test changes to dashboard on azure #245
maxheld83 Jul 21, 2020
caa5c92
embed shiny on azure in pkgdown #245
maxheld83 Jul 21, 2020
9278766
only push to ghpages from master
maxheld83 Jul 21, 2020
0ea4bd0
Merge branch 'master' into azure
maxheld83 Jul 22, 2020
502e2c3
upgrade hoad to shinycaas and muggle
maxheld83 Aug 17, 2020
31314c0
fix container
maxheld83 Aug 17, 2020
09177df
factor out more deploy stuff
maxheld83 Aug 20, 2020
e981ac2
invalidate cache and remove rsconnect
maxheld83 Aug 20, 2020
c9c7ecc
migrate to subugoetheme
maxheld83 Aug 20, 2020
2eb6c75
hard-code hoad
maxheld83 Aug 20, 2020
b531ec4
try fresh run
maxheld83 Aug 20, 2020
3f53e3e
upgrade muggle
maxheld83 Aug 21, 2020
c1ab907
try with bare string
maxheld83 Aug 21, 2020
85cf576
set env one level higher
maxheld83 Aug 21, 2020
4bdf513
set tag twice
maxheld83 Aug 21, 2020
925e49b
revert passing on MUGGLE_TAG
maxheld83 Aug 21, 2020
315bb20
fix lingering metar refs
maxheld83 Aug 21, 2020
7085e87
fix bad yaml
maxheld83 Aug 21, 2020
4cac093
try with restart
maxheld83 Aug 21, 2020
0ffbcc4
add sleep
maxheld83 Aug 21, 2020
c7c6994
add shinycaas
maxheld83 Aug 24, 2020
7d8e7f2
fix bad template call
maxheld83 Aug 24, 2020
157987a
add sleep in same job
maxheld83 Aug 24, 2020
228ec1b
reduce sleep and hardcode deps
maxheld83 Aug 24, 2020
4f2e957
try sleeping in separate process
maxheld83 Aug 24, 2020
56376b0
reduce sleep
maxheld83 Aug 24, 2020
4e4a11e
increase sleep
maxheld83 Aug 24, 2020
7cadb91
increase sleep
maxheld83 Aug 24, 2020
74c8725
increase sleep
maxheld83 Aug 24, 2020
a92d94a
remove obsolete workspace
maxheld83 Nov 18, 2020
f6f3c1c
add newsletter email
maxheld83 Dec 3, 2020
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ hoad.code-workspace
^R/.scoap\.R$
^R/.unpaywall_integration\.R$
.vscode
.azure
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
!/NAMESPACE
!/LICENSE.md
!/.Rbuildignore
!/.azure/init.sh
2 changes: 1 addition & 1 deletion .github/newsletter.md
Original file line number Diff line number Diff line change
@@ -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 `[email protected]` informieren wir Sie über neue Entwicklungen und Veranstaltungen rund um das Projekt.

<form method="post" action="https://listserv.gwdg.de/mailman/subscribe/hoad">
<div class="form-group">
Expand Down
68 changes: 40 additions & 28 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
on:
push:
on: push

jobs:
CICD:
Expand All @@ -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
Expand All @@ -23,21 +25,23 @@ 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
run: |
# 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
Expand All @@ -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/[email protected]
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)
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -88,4 +88,5 @@ Imports:
ggplot2,
rlang
Remotes:
subugoe/metar@7ccc2a0
subugoe/[email protected],
subugoe/shinycaas@31684600b286d5da5639a430a4b83a04de36bd34
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion R/plots.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 0 additions & 8 deletions hoad.code-workspace

This file was deleted.

4 changes: 2 additions & 2 deletions inst/app/dashboard.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down Expand Up @@ -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).

Expand Down
4 changes: 2 additions & 2 deletions man/colors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -17,7 +18,7 @@ authors:
href: https://github.com/openapc
html: <img src="reference/figures/openAPC_01+.png" height="15">
template:
package: metar
package: subugoetheme
opengraph:
twitter:
site: "@subugoe"
Expand Down
33 changes: 3 additions & 30 deletions vignettes/interactive.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@
title: "Interactive Dashboard"
---

<style>
.shiny-app-frame {
margin-top: 50px;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
}
.shiny-app-frame iframe {
width: 100%;
height: 100%;
border: none;
}
/* must be hidden otherwise it gets overlaid over the app */
footer{
visibility: hidden
}
.page-header{
visibility: hidden
}
</style>


<!-- TODO this needs to be updated manually, until https://github.com/subugoe/hoad/issues/180 -->

<div class="shiny-app-frame">
<iframe id="2343078" src="https://subugoe.shinyapps.io/hoad-refs-heads-refactor-as-pkg/">
</iframe>
</div>
```{r echo=FALSE}
shinycaas::include_app2("https://hoad.azurewebsites.net")
```