Skip to content

Update data, forecasts, plots and render doc #1076

Update data, forecasts, plots and render doc

Update data, forecasts, plots and render doc #1076

# Get hourly data
name: Update data, forecasts, plots and render doc
# Configure Manual Trigger
on:
workflow_dispatch:
schedule:
- cron: '00 13 * * *' # 14:00 CET = 13:00 UTC
- cron: '15 14 * * *' # 15:15 CET = 14:15 UTC
- cron: '30 15 * * *' # 16:30 CET = 15:30 UTC
# 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:
- name: Print the time
run: echo "The time is $(date)"
- 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 ffail
env:
KEY_FFAIL_DATA: ${{ secrets.KEY_FFAIL_DATA }}
run: Rscript scripts/get_hourly_data_ffail.R
# # Run R script
# - name: Get hourly data nordpool
# run: Rscript scripts/get_hourly_data_nordpool.R
# Run R script
- name: Filter prices with sept_2023 system
run: Rscript scripts/filter.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 "[email protected]"
# Check if there are any changes
if [ -n "$(git status --porcelain)" ]; then
git add *
git commit -am "GHA update data, forecasts, plots and render doc $(date)"
git push
else
echo "No changes to commit"
fi