Skip to content

Create new modeling round #67

Create new modeling round

Create new modeling round #67

name: Create new modeling round
on:
schedule:
- cron: "0 03 * * 1" # every Monday at 3 AM UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
create-clade-modeling-round:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
# don't check out repo folders with large amounts of data
# (e.g., model-output, target-data)
sparse-checkout: |
auxiliary-data/
hub-config/
src/
- name: Install uv 🐍
uses: astral-sh/setup-uv@v2
with:
version: "0.4.9"
- name: Set up R 📊
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.4.1
install-r: true
use-public-rspm: true
extra-repositories: 'https://hubverse-org.r-universe.dev'
- name: Set up renv 📦
uses: r-lib/actions/setup-renv@v2
with:
working-directory: src
- name: Create clade list and update tasks.json 🦠
run: |
uv run get_clades_to_model.py
Rscript make_round_config.R
working-directory: src
- name: Get current date and time 🕰️
run: |
PR_DATETIME=$(date +'%Y-%m-%d_%H-%M-%S')
echo "PR_DATETIME=$PR_DATETIME" >> $GITHUB_ENV
- name: Create PR for new modeling round 🚀
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b new_round_"$PR_DATETIME"
git add auxiliary-data/modeled-clades/
git add hub-config/
git commit -m "Add new round $PR_DATETIME"
git push -u origin new_round_"$PR_DATETIME"
gh pr create \
--base main \
--title "Add new round $PR_DATETIME" \
--body "This PR was created via GitHub Actions: generate clade list and add new round to tasks.json."