-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: append daily CI data | ||
|
||
on: push | ||
jobs: | ||
run_container: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: kasiatemp/ng-update:shiny | ||
env: | ||
SHINY_ACC_NAME=${{secrets.SHINY_ACC_NAME}} | ||
TOKEN=${{secrets.TOKEN}} | ||
SECRET=${{secrets.SECRET}} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'main' | ||
- name: Deploy app | ||
run: | | ||
bash Rscript deploy.R |
File renamed without changes.
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
carbon-intensity-app.Rproj | ||
rsconnect/ | ||
.DS_Store | ||
.Renviron |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
library(rsconnect) | ||
# a function to stop the script when one of the variables cannot be found. and to strip quotation marks from the secrets when you supplied them. (maybe it is just easier to never use them) | ||
error_on_missing_name <- function(name) { | ||
var <- Sys.getenv(name, unset = NA) | ||
if (is.na(var)) { | ||
stop(paste0("cannot find ", name, " !"), call. = FALSE) | ||
} | ||
gsub("\"", '', var) | ||
} | ||
|
||
# Authenticate | ||
setAccountInfo( | ||
name = error_on_missing_name("SHINY_ACC_NAME"), | ||
token = error_on_missing_name("TOKEN"), | ||
secret = error_on_missing_name("SECRET") | ||
) | ||
|
||
# Deploy the application. | ||
deployApp(appName = "carbon-intensity-app", | ||
appTitle = "Carbon Intensity App") |