generated from dfe-analytical-services/shiny-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from dfe-analytical-services/development
Update deploy script
- Loading branch information
Showing
17 changed files
with
4,869 additions
and
677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- development | ||
|
||
name: deploy-shiny | ||
|
||
|
@@ -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 | ||
|
@@ -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. | ||
|
@@ -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}})" | ||
Oops, something went wrong.