Skip to content

Commit

Permalink
Merge branch 'main' into footer-links
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rogers-hub authored Jan 24, 2025
2 parents 6f1d039 + 969c794 commit b9e76cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 64 deletions.
72 changes: 8 additions & 64 deletions .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,14 @@
name: Deploy Dashboard
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development

name: shinyapps.io deploy

jobs:
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: 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: 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)"
deploy:
uses: dfe-analytical-services/dfeshiny/.github/workflows/dashboard_deploy_template.yaml@main
with:
parameter_file: deploy-parameters.yaml
secrets:
SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }}
SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }}
2 changes: 2 additions & 0 deletions deploy-parameters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dashboard_name: dev-dfe-shiny-template
deploy_target: shinyapps

0 comments on commit b9e76cc

Please sign in to comment.