Skip to content

Commit

Permalink
Merge branch 'main' into add-dashboard-deploy-template
Browse files Browse the repository at this point in the history
  • Loading branch information
oadetayo authored Jan 3, 2025
2 parents c09c71c + 61f2769 commit ffc3e7e
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 379 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/automated-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
- name: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Install proj library (terra depdencies)
run: sudo apt-get install libproj-dev

- name: Install gdal library (terra dependencies)
run: sudo apt-get install libgdal-dev

- name: Install udunits library (units dependencies)
run: sudo apt-get install libudunits2-dev

- name: Cache renv packages
id: cache-renv
uses: actions/cache@v4
Expand Down
57 changes: 56 additions & 1 deletion .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,64 @@ on:
branches:
- main
- development
pull_request:
branches:
- main
- development

jobs:
<<<<<<< add-dashboard-deploy-template
deploy:
uses: dfe-analytical-services/dfeshiny/.github/workflows/dashboard_deploy_template.yaml@main
with:
parameter_file: deploy_parameters.yaml
parameter_file: deploy_parameters.yaml
=======
deployShiny:
runs-on: ubuntu-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-dfe-shiny-template'" >> $GITHUB_ENV
echo "SHINYAPP_OVERFLOW_NAME='dev-dfe-shiny-template-overflow'">> $GITHUB_ENV
- name: Set env vars (prod)
if: endsWith(github.ref, '/main')
run: |
echo "SHINYAPP_NAME='dfe-shiny-template'">> $GITHUB_ENV
echo "SHINYAPP_OVERFLOW_NAME='dfe-shiny-template-overflow'">> $GITHUB_ENV
- 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: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::install("rsconnect")
# Tokens are stored as secrets in GitHub to make sure only DfE analysts can publish apps in our shiny.io area
# Navigate to Settings > Secrets to add and view secrets. These can also be things like admin login and passwords for SQL databases.
# Get in touch with the Explore education statistics platforms team if you need to add the below secrets to publish to shinyapps.io

- name: Push to shiny.io
if: github.event_name != 'pull_request'
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)"
>>>>>>> main
64 changes: 64 additions & 0 deletions .github/workflows/tidyCode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
branches:
- main
pull_request:

name: tidyCode

jobs:
tidyCode:
runs-on: ubuntu-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: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Install proj library (terra depdencies)
run: sudo apt-get install libproj-dev

- name: Install gdal library (terra dependencies)
run: sudo apt-get install libgdal-dev

- name: Install udunits library (units dependencies)
run: sudo apt-get install libudunits2-dev

- name: Restore renv snapshot
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
- name: Tidy code
shell: Rscript {0}
run: |
codeChecks <- dfeshiny::tidy_code()
if(any(is.na(codeChecks))) {
stop("There is a breaking error in the code.")
} else {
if(TRUE %in% codeChecks) {
stop("The code is not styled correctly. Open the project in RStudio and use tidy_code() to restyle the code.")
} else {
message("----------------------------------------")
message("The code is beautiful, go you!")
message("----------------------------------------")
}
}
- name: Upload test results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-tests
path: tests
156 changes: 0 additions & 156 deletions R/ui_panels/accessibility_statement.R

This file was deleted.

1 change: 1 addition & 0 deletions R/ui_panels/example_tab_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ example_tab_1_panel <- function() {
gov_row(
column(
width = 12,
id = "main_col",
h1("Overall content title for this dashboard page"),
),
# Expandable section --------------------------------------------------
Expand Down
Loading

0 comments on commit ffc3e7e

Please sign in to comment.