Add a stub R script for adding a new modeling round to the hub #24
Workflow file for this run
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
name: Create new modeling round | |
on: | |
push: | |
schedule: | |
- cron: "0 03 * * 1" # every Monday at 3 AM UTC | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
create-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 Python 🐍 | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "src/.python-version" | |
- name: Create clade list 🦠 | |
run: | | |
uv run src/get_clades_to_model.py | |
- name: Set up R 📊 | |
uses: r-lib/actions/setup-r@v2 | |
- name: Generate new round config 📝 | |
run: | | |
Rscript src/make_round_config.R | |
- 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 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 new round config." |