Skip to content

.github/workflows/run_forecast.yaml #367

.github/workflows/run_forecast.yaml

.github/workflows/run_forecast.yaml #367

Workflow file for this run

on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
jobs:
run_forecast:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
container:
image: eco4cast/rocker-neon4cast
steps:
- run: git config --system --add safe.directory '*'
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run automatic prediction file
run: Rscript -e 'rmarkdown::render(input = "Submit_forecast/forecast_code_template.Rmd")'
- name: commit + push output
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git pull
git add Submit_forecast/forecast_code_template.html
git commit -m "New forecast generated" || echo "No changes to commit"
git push https://${GITHUB_PAT}:${GITHUB_PAT}@github.com/${GITHUB_REPOSITORY}