Skip to content

Fetch and ingest (on branch) #24

Fetch and ingest (on branch)

Fetch and ingest (on branch) #24

name: Fetch and ingest (on branch)
on:
# Manually triggered using GitHub's UI
workflow_dispatch:
inputs:
image:
description: 'Specific container image to use for build (will override the default of "nextstrain build")'
required: false
jobs:
set_config_overrides:
runs-on: ubuntu-latest
steps:
- id: upload_config
run: |
# Create JSON string for the nested upload config
GITHUB_BRANCH=${GITHUB_REF#refs/heads/}
S3_DST="s3://nextstrain-data/files/workflows/monkeypox/branch/${GITHUB_BRANCH}"
UPLOAD_CONFIG=$(jq -cn --arg S3_DST "$S3_DST" '{"s3": {"dst": $S3_DST }}')
echo "upload_config=$UPLOAD_CONFIG" >> "$GITHUB_OUTPUT"
outputs:
upload_config: ${{ steps.upload_config.outputs.upload_config }}
fetch-and-ingest:
needs: [set_config_overrides]
permissions:
id-token: write
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master
secrets: inherit
with:
runtime: aws-batch
env: |
NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image }}
GITHUB_RUN_ID: ${{ github.run_id }}
UPLOAD_CONFIG: ${{ needs.set_config_overrides.outputs.upload_config }}
run: |
nextstrain build \
--aws-batch \
--detach \
--no-download \
--cpus 32 \
--memory 64gib \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env GITHUB_RUN_ID \
ingest \
--configfiles config/config.yaml config/optional.yaml \
--config trigger_rebuild=False send_slack_notifications=False upload="$UPLOAD_CONFIG"