Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy private nextflu builds to Netlify #122

Merged
merged 3 commits into from
Sep 14, 2023
Merged

Conversation

joverlee521
Copy link
Contributor

@joverlee521 joverlee521 commented Sep 8, 2023

Description of proposed changes

The private.nextflu.org site is still built using the old Auspice
version in https://github.com/blab/nextflu and deployed to Netlify.
This requires an older version of Ruby (2.3.7) and dependencies that
others have had trouble installing on the new M1 macs. Instead of
depending on my old mac to deploy the private builds, use a GitHub
Action workflow to deploy the site that anyone on the Nextstrain team
can run.

I've opted for this route instead of trying to update the dependencies
for the old Auspice because the ultimate goal is to sunset the private
site. This seemed like less work than fiddling with dependencies.

Note

For this new workflow, I had to add ruby/setup-ruby@v1 to the Nextstrain's list of allowed actions.

Next steps

This can be run manually for now, but would be best to connect with the private builds to auto-deploy to the private site when the build succeeds.

The easiest route would be to keep the private builds attached to the AWS Batch job and then trigger this new workflow
when the job is complete. The private builds are running up to ~4hrs, which is within GH's 6hr job limit. However, I'm not doing this now since we still have limited concurrency for GH Actions.

This basic workflow is able to build the empty site and deploy to
staging-private-nextflu.netlify.app, which is still password protected.

The private.nextflu.org site is still built using the old Auspice
version in https://github.com/blab/nextflu and deployed to Netlify.
This requires an older version of Ruby (2.3.7) and dependencies that
others have had trouble installing on the new M1 macs. Instead of
depending on my old mac to deploy the private builds, create to a GitHub
Action workflow  to deploy the site that anyone on the Nextstrain team
can run.

I've opted for this route instead of trying to update the dependencies
for the old Auspice because the ultimate goal is to sunset the private
site. This seemed like less work than fiddling with dependencies.
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
The default will now deploy to the production site at private.nextflu.org.

If the input is true, then will deploy to the staging site at
staging-private-nextflu.netlify.app
@joverlee521
Copy link
Contributor Author

Tested deploying with the latest private builds from yesterday.

Triggered the deployment to staging with:

gh workflow run -R nextstrain/seasonal-flu -r deploy-private-nextflu deploy-private-nextflu.yaml -f aws_batch_job_id=f8327e63-86ee-4d59-8c01-1cf1e25a9319 -f deploy_to_staging=true

Triggered the deployment to production with:

gh workflow run -R nextstrain/seasonal-flu -r deploy-private-nextflu deploy-private-nextflu.yaml -f aws_batch_job_id=f8327e63-86ee-4d59-8c01-1cf1e25a9319 -f deploy_to_staging=false

Both runs completed successfully, but logs show they uploaded 0 files because I had already deployed to Netlify manually this morning. Can test again with next week's builds.

@joverlee521 joverlee521 requested review from a team and removed request for alliblk September 8, 2023 22:24
@joverlee521
Copy link
Contributor Author

Today's private nextflu builds have been successfully deployed with

gh workflow run -R nextstrain/seasonal-flu -r deploy-private-nextflu deploy-private-nextflu.yaml -f aws_batch_job_id=68103acc-3c93-4863-8d1b-c7a89d539c31 -f deploy_to_staging=false

@joverlee521 joverlee521 merged commit 88b8938 into master Sep 14, 2023
7 checks passed
@joverlee521 joverlee521 deleted the deploy-private-nextflu branch September 14, 2023 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

1 participant