Skip to content

Commit

Permalink
Merge pull request #10 from dfe-analytical-services/development
Browse files Browse the repository at this point in the history
Update deploy script
  • Loading branch information
chfoster authored Oct 19, 2023
2 parents d746a55 + 868dfbe commit 69ce79e
Show file tree
Hide file tree
Showing 17 changed files with 4,869 additions and 677 deletions.
2 changes: 1 addition & 1 deletion .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cat("Sourcing .Rprofile.", fill = TRUE)

source("renv/activate.R")

# Tidy code function
# Tidy code functiona
tidy_code <- function() {
source("global.r")
tidy_code_function()
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
push:
branches:
- main
- development

name: deploy-shiny

Expand Down Expand Up @@ -31,6 +32,15 @@ jobs:
r-version: 4.2.1
use-public-rspm: true

- name: Set env vars (dev)
if: endsWith(github.ref, '/development')
run: |
echo "SHINYAPP_NAME='dev-KS4-ready-reckoners'" >> $GITHUB_ENV
- name: Set env vars (prod)
if: endsWith(github.ref, '/main')
run: |
echo "SHINYAPP_NAME='KS4-transition-matrices'">> $GITHUB_ENV
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
Expand All @@ -56,7 +66,8 @@ jobs:
- name: Install rsconnect
shell: Rscript {0}
run: |
install.packages("rsconnect")
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::install("[email protected]")
# 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.
Expand All @@ -66,5 +77,5 @@ jobs:
run: >
Rscript
-e "rsconnect::setAccountInfo(name = 'department-for-education', token = '${{secrets.SHINYAPPS_TOKEN}}', secret = '${{secrets.SHINYAPPS_SECRET}}')"
-e "rsconnect::deployApp(appName='KS4-transition-matrices')"
# -e "rsconnect::deployApp(appName='KS4-transition-matrices-overflow')"
-e "rsconnect::deployApp(appName=${{env.SHINYAPP_NAME}})"
Loading

0 comments on commit 69ce79e

Please sign in to comment.