Skip to content

COVID-19 case counts #576

COVID-19 case counts

COVID-19 case counts #576

name: COVID-19 case counts
on:
schedule:
- cron: '0 16 * * *'
workflow_dispatch:
inputs:
slack_channel:
description: 'Slack channel to push update alerts. Default channel is nextstrain-counts-updates.'
required: false
trial_name:
description: 'Short name for a trial run. WARNING: without this we will overwrite files in s3://nextstrain-data/files/workflows/forecasts-ncov/cases.'
required: false
jobs:
case_counts:
runs-on: ubuntu-latest
env:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNELS: ${{ github.event.inputs.slack_channel || 'nextstrain-counts-updates' }}
defaults:
run:
# Login shell is required to include changes by conda init bash.
shell: bash -l -eo pipefail {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.9"
miniforge-variant: Mambaforge
channels: conda-forge,bioconda
- name: setup
run: mamba install "csvtk>=0.23.0"
- name: download case counts
run: |
./ingest/bin/fetch-ncov-global-case-counts > global_case_counts.tsv
- name: upload to S3
run: |
S3_DST=s3://nextstrain-data/files/workflows/forecasts-ncov/cases
CLOUDFRONT_DOMAIN="data.nextstrain.org"
if [[ "$TRIAL_NAME" ]]; then
S3_DST+=/trial/"$TRIAL_NAME"
fi
./ingest/vendored/upload-to-s3 global_case_counts.tsv "$S3_DST"/global.tsv.gz $CLOUDFRONT_DOMAIN
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TRIAL_NAME: ${{ github.event.inputs.trial_name }}
- name: notify_pipeline_failed
if: ${{ failure() }}
run: ./ingest/vendored/notify-on-job-fail "Case counts ingest" "nextstrain/forecasts-ncov"