Skip to content

CovidHub-ensemble

CovidHub-ensemble #4

name: "CovidHub-ensemble"
on:
workflow_dispatch:
schedule:
- cron: "00 15 * * 4"
jobs:
generate-covidhub-ensemble:
runs-on: ubuntu-latest
steps:
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v4
with:
application_id: ${{ vars.GH_APP_ID }}
application_private_key: ${{ secrets.GH_APP_KEY }}
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
install-r: false
use-public-rspm: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Install dependencies
run: |
install.packages(c("hubEnsembles", "dplyr", "lubridate", "purrr", "yaml", "argparser", "remotes"))
remotes::install_github("hubverse-org/hubData")
shell: Rscript {0}
- name: generate ensemble
run: |
TODAY=$(date +'%Y-%m-%d')
REF_DATE=$(date -d "$TODAY + 2 days" +'%Y-%m-%d')
Rscript src/code/get_ensemble.r --reference-date "$REF_DATE"
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: "Add CovidHub ensemble forecasts"
default_author: github_actions
push: true
new_branch: add-ensemble
- name: Create pull request
id: create_pr
run: |
gh pr create --base main --head add-ensemble --title "Add ensemble forecast" --body "This PR is generated automatically to add a quantile median ensemble forecast."
env:
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }}