Skip to content

Run USA models

Run USA models #40

name: Run USA models
on:
workflow_dispatch:
schedule:
# Run every Wednesday at 10am PT which is 5pm (17:00) UTC.
- cron: '0 17 * * 3'
jobs:
run_models:
permissions:
id-token: write
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master
secrets: inherit
with:
runtime: docker
run: |
nextstrain build \
--image nextstrain/base \
--env AWS_DEFAULT_REGION \
--env GITHUB_RUN_ID \
. \
prepare_all_hub_submissions \
--configfile config/config.yaml config/variant_hub.yaml
env: |
GITHUB_RUN_ID: ${{ github.run_id }}
artifact-name: model-outputs
artifact-paths: |
hub/submissions.txt
hub/model-output/
!results/
upload_models:
needs: [run_models]
runs-on: ubuntu-latest
steps:
- name: Extract model outputs
uses: actions/download-artifact@v6
with:
name: model-outputs
- name: Clone fork of variant nowcast hub
uses: actions/checkout@v6
with:
repository: nextstrain/variant-nowcast-hub
path: variant-nowcast-hub
token: ${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_REPO }}
- name: Upload model outputs to hub fork
run: |
rsync -arvz --files-from=hub/submissions.txt hub/ variant-nowcast-hub/
cd variant-nowcast-hub
export DATE="$(date "+%Y-%m-%d")"
git switch -c blab-${DATE}
git add --pathspec-from-file=../hub/submissions.txt
git commit -m "Add blab models for ${DATE}"
git push origin blab-${DATE}
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${HUB_OWNER}/${HUB_REPO}/pulls \
-f title="Add blab models for ${DATE}" \
-f body="" \
-f head="nextstrain:blab-${DATE}" \
-f base=main
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_REPO }}
GIT_AUTHOR_EMAIL: ${{ vars.GIT_USER_EMAIL_NEXTSTRAIN_BOT }}
GIT_AUTHOR_NAME: ${{ vars.GIT_USER_NAME_NEXTSTRAIN_BOT }}
GIT_COMMITTER_EMAIL: ${{ vars.GIT_USER_EMAIL_NEXTSTRAIN_BOT }}
GIT_COMMITTER_NAME: ${{ vars.GIT_USER_NAME_NEXTSTRAIN_BOT }}
HUB_OWNER: reichlab
HUB_REPO: variant-nowcast-hub