-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.61 KB
/
publishing-workflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
on:
push:
paths:
- sc_dashboard.Rmd
- .github/workflows/publishing-workflow.yaml
schedule:
- cron: '35 15,18,21 * * *'
name: Render Dashboard
jobs:
render:
name: Render Dashboard
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Prepare repository
run: git checkout "${GITHUB_REF:11}"
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install tibble
run: Rscript -e 'install.packages(c("tibble"), type = "binary")'
- name: Install dependencies
run: Rscript -e 'install.packages(c("rmarkdown", "flexdashboard", "broom", "tidyverse", "jtools", "lubridate", "extrafont", "ggplot2", "plotly", "xml2", "rvest", "tigris", "tidycensus", "sf", "tsibble", "slider", "ggthemes"), type = "binary")'
- name: Render Dashboard
env:
CENSUS_API_KEY: ${{ secrets.CENSUS_API_KEY }}
run: Rscript -e 'rmarkdown::render("sc_dashboard.Rmd", flexdashboard::flex_dashboard(navbar = list(list(title = paste("Updated:", format(as.Date(Sys.time(), tz = "America/New_York"), "%B %e, %Y")), icon = "far fa-clock"), list(title = "Author", href = "https://jacob-long.com", icon = "fa-user-edit")), source_code = "https://github.com/jacob-long/SC-COVID-19-Dashboard", css = "sc_dash.css", theme = "flatly", orientation = "row", vertical_layout = "fill"))'
- name: Commit results
run: |
git config --global user.name "Runner"
git config --global user.email "[email protected]"
git commit sc_dashboard.html -m 'Re-build sc_dashboard.html'
git push origin