Update data, forecasts, plots and render doc #260
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
# Get hourly data | |
name: Update data, forecasts, plots and render doc | |
# Controls when the action will run. | |
on: | |
schedule: | |
- cron: '15 11 * * *' | |
# push: | |
# Controls when the action will run. | |
#on: [push, pull_request] | |
jobs: | |
run_rscripts: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Load repo and install R | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
packages: | | |
any::data.table | |
any::lubridate | |
any::rjson | |
any::flextable | |
any::forecast | |
any::ggplot2 | |
any::webshot | |
any::rmarkdown | |
any::patchwork | |
any::jsonlite | |
# Run R script | |
- name: Get hourly data nordpool | |
run: Rscript scripts/get_hourly_data_nordpool.R | |
# Run R script | |
- name: Estimate compensation | |
run: Rscript scripts/forecast.R | |
# Run R script | |
- name: Compensation table | |
run: Rscript scripts/viz_compensation.R | |
# Run R script | |
- name: Plot compensation and mean price | |
run: Rscript scripts/viz_compensation_month.R | |
# Run R script | |
- name: Render README | |
run: Rscript -e 'rmarkdown::render("README.Rmd",output_format="all")' | |
# Add new files in data folder, commit along with other modified files, push | |
- name: Commit files | |
run: | | |
git config --local user.name actions-user | |
git config --local user.email "actions@github.com" | |
git add * | |
git commit -am "GHA update data, forecasts, plots and render doc $(date)" | |
git push |