From d58a45ecea549464fee7ede44bd35cba5f1eda5d Mon Sep 17 00:00:00 2001 From: Jover Date: Fri, 8 Sep 2023 13:26:57 -0700 Subject: [PATCH] deploy-private-nextflu: Download builds with AWS Batch Job ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds an input for the AWS Batch Job ID to be able to attach to a private nextflu build and build the site with the output Auspice JSONs. Requires the Auspice JSONs to be in `auspice-who` since that is the output directory for the private.nextflu.org profile.¹ ¹ https://github.com/nextstrain/seasonal-flu/blob/80f3be31a56abd92908a56343edb7af48fa38274/profiles/private.nextflu.org/export.smk#L17 --- .github/workflows/deploy-private-nextflu.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/deploy-private-nextflu.yaml b/.github/workflows/deploy-private-nextflu.yaml index aae60c7b..8908ffda 100644 --- a/.github/workflows/deploy-private-nextflu.yaml +++ b/.github/workflows/deploy-private-nextflu.yaml @@ -2,11 +2,17 @@ name: Deploy private.nextflu.org on: workflow_dispatch: + inputs: + aws_batch_job_id: + description: The AWS Batch Job ID for the private nextflu seasonal flu builds. + type: string + required: true env: # Everything should run from within the nextflu/auspice directory # https://github.com/blab/nextflu/tree/e672eba6d2e0ad5e10b0775f94fc87ffc75d6005/auspice WORKING_DIR: auspice + AUSPICE_DIR: auspice-who defaults: run: @@ -37,6 +43,30 @@ jobs: # https://github.com/blab/nextflu/blob/12c5645d990f53c553d6f04e293e2f12b4ad3575/auspice/Gemfile.lock working-directory: ${{ env.WORKING_DIR }} + - uses: nextstrain/.github/actions/setup-nextstrain-cli@master + + - name: Download builds from AWS Batch + run: | + nextstrain build \ + --aws-batch \ + --attach "$AWS_BATCH_JOB_ID" \ + --download "$AUSPICE_DIR/*.json" \ + --no-logs \ + . + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_BATCH_JOB_ID: ${{ inputs.aws_batch_job_id }} + + - name: Move Auspice JSONs + run: | + mkdir data + mv "$AUSPICE_DIR"/*.json data/ + rm -r "$AUSPICE_DIR" + + - name: Create index filex + run: python provision_directories.py + - name: Build site run: bundle exec jekyll build