Skip to content

Commit

Permalink
Merge pull request #117 from dfe-analytical-services/eesp/dfeshiny-de…
Browse files Browse the repository at this point in the history
…ploy

Switched deployment to dfeshiny process (and updated dfeshiny package)
  • Loading branch information
rmbielby authored Jan 23, 2025
2 parents d6e6df5 + 77fc293 commit b662485
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 89 deletions.
59 changes: 6 additions & 53 deletions .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,13 @@
name: Deploy Dashboard

on:
push:
branches:
- main
- development

name: deploy-shiny

jobs:
deployShiny:
runs-on: macOS-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

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

- name: Set env vars (dev)
if: endsWith(github.ref, '/development')
run: |
echo "SHINYAPP_NAME='dev-pupil-attendance-in-schools'" >> $GITHUB_ENV
echo "SHINYAPP_OVERFLOW_NAME='dev-pupil-attendance-in-schools-overflow'">> $GITHUB_ENV
- name: Set env vars (prod)
if: endsWith(github.ref, '/main')
run: |
echo "SHINYAPP_NAME='pupil-attendance-in-schools'">> $GITHUB_ENV
echo "SHINYAPP_OVERFLOW_NAME='pupil-attendance-in-schools-overflow'">> $GITHUB_ENV
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Restore renv snapshot
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
- name: Install rsconnect
shell: Rscript {0}
run: |
install.packages("rsconnect")
- name: Push to shiny.io
run: >
Rscript
-e "rsconnect::setAccountInfo(name = 'department-for-education', token = '${{secrets.SHINYAPPS_TOKEN}}', secret = '${{secrets.SHINYAPPS_SECRET}}')"
-e "rsconnect::deployApp(appName=${{env.SHINYAPP_NAME}}, forceUpdate = TRUE)"
-e "rsconnect::deployApp(appName=${{env.SHINYAPP_OVERFLOW_NAME}}, forceUpdate = TRUE)"
deploy:
uses: dfe-analytical-services/dfeshiny/.github/workflows/deploy-dashboard-template.yaml@main
with:
parameter_file: deploy_parameters.yaml
2 changes: 2 additions & 0 deletions deploy-parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dashboard_name: "pupil-attendance-in-schools"
deploy_target: "shinyapps"
57 changes: 31 additions & 26 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.4.1",
"Version": "4.4.2",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -172,18 +172,6 @@
],
"Hash": "45f0398006e83a5b10b72a90663d8d8c"
},
"RCurl": {
"Package": "RCurl",
"Version": "1.98-1.16",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"bitops",
"methods"
],
"Hash": "ddbdf53d15b47be4407ede6914f56fbb"
},
"RODBC": {
"Package": "RODBC",
"Version": "1.3-26",
Expand Down Expand Up @@ -260,13 +248,6 @@
],
"Hash": "e84984bf5f12a18628d9a02322128dfd"
},
"bitops": {
"Package": "bitops",
"Version": "1.0-9",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "d972ef991d58c19e6efa71b21f5e144b"
},
"brio": {
"Package": "brio",
"Version": "1.1.5",
Expand Down Expand Up @@ -497,28 +478,28 @@
},
"dfeshiny": {
"Package": "dfeshiny",
"Version": "0.5.1",
"Version": "0.5.3.9000",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "dfe-analytical-services",
"RemoteRepo": "dfeshiny",
"RemoteRef": "bff6fef6be5049c7a4a41b350244dba6320ecd7c",
"RemoteSha": "bff6fef6be5049c7a4a41b350244dba6320ecd7c",
"RemoteRef": "main",
"RemoteSha": "76de5eed9cea8ec5402c4daa8a776c38bfb40e52",
"RemoteHost": "api.github.com",
"Requirements": [
"R",
"RCurl",
"checkmate",
"glue",
"htmltools",
"lubridate",
"magrittr",
"shiny",
"shinyGovstyle",
"shinyjs",
"stringr",
"styler"
],
"Hash": "5d235ed45e2b4c8a6892f157c3117b04"
"Hash": "e347ea865a8baa260a6a5954e8104557"
},
"diffobj": {
"Package": "diffobj",
Expand Down Expand Up @@ -986,6 +967,19 @@
],
"Hash": "b8552d117e1b808b09a832f589b79035"
},
"lubridate": {
"Package": "lubridate",
"Version": "1.9.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"generics",
"methods",
"timechange"
],
"Hash": "be38bc740fc51783a78edb5a157e4104"
},
"magrittr": {
"Package": "magrittr",
"Version": "2.0.3",
Expand Down Expand Up @@ -1819,6 +1813,17 @@
],
"Hash": "829f27b9c4919c16b593794a6344d6c0"
},
"timechange": {
"Package": "timechange",
"Version": "0.3.0",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"cpp11"
],
"Hash": "c5f3c201b931cd6474d17d8700ccb1c8"
},
"tinytex": {
"Package": "tinytex",
"Version": "0.54",
Expand Down
13 changes: 3 additions & 10 deletions ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,14 @@ ui <- function(input, output, session) {
href = "dfe_shiny_gov_style.css"
)
),
shinyGovstyle::header(
main_text = "",
secondary_text = "DfE pupil attendance and absence in schools in England: data dashboard",
logo = "images/DfE_logo_landscape.png",
logo_width = 150,
logo_height = 32
dfeshiny::header(
header = "Pupil attendance and absence in schools in England"
),
shinyGovstyle::banner(
"beta banner",
"beta",
paste0(
"This Dashboard is in beta phase and we are still reviewing performance and reliability. ",
"In case of slowdown or connection issues due to high demand, we have produced two instances of this site which can be accessed at the following links: ",
"<a href=", site_primary, " id='link_site_1'>Site 1</a> and ",
"<a href=", site_overflow, " id='link_site_2'>Site 2</a>."
"This Dashboard is in beta phase and we are still reviewing performance and reliability. "
)
),
shiny::navlistPanel(
Expand Down

0 comments on commit b662485

Please sign in to comment.