This repository stores source code used to generate the website of the COVID-19 Forecast Hub.
Note: As of Wednesday, May 1, 2024, the US COVID-19 Forecast Hub is no longer accepting submissions. Information provided on forecast submissions are kept for historical record.
Most pages can be edited directly and are located in the doc
folder and corresponding subdirectories. Subdirectories have the name of the corresponding tab or submenu in the webpage and the main landing page is usually the file named index.md
within that folder. To have changes reflected on the website, those markdown files need to be edited and then the site must be deployed, as detailed below.
For example, to edit the “Reports” landing page, accessible via the “Reports” tab on the COVID-19 Forecast Hub main page, edit the file in doc/reports/index.md
Weekly reports were generated and deployed automatically by the virtual machine on Tuesdays at 8:30 am using the run-weekly-reports.sh
script.
Evaluation reports were produced on a monthly basis. First, this script was run locally. It took approximately one day to run and required manual saves and restarts. Afterwards, this script was run to generate the evaluation report. This did not take long to run. Finally, the report was reviewed manually by team members. If the report looked good, it was uploaded to this repository. The monthly evaluation report should not be uploaded on a Tuesday, as it may cause conflict with other actions scheduled for Tuesdays.
Reports and edits were deployed to the site using the deploy-covidhub-site.sh
script, as explained below.
- If it is a PDF (or any other static file), you can add the file in the talks folder and the url to link would just be
/talks/[filename_with_extension]
. Ignore this step if it you want to add an existing URL. - Add an item to the list here. You can use the following line as a template if you want:
- Talk name [link](https://link-to-your-talk.com){:target="_blank"} (Date)
The website updates are done automatically on Tuesdays using a virtual machine. Manual updates can be triggered only with access to the virtual machine.
Specifically, on Tuesday at 8:30 am, a first script pulls the latest covid19-forecast-hub and covid19-forecast-hub-web commits, runs render_reports.R
, and copies and commits the resulting reports html files.
At 11 am and 2 pm, a second script updates community and reports data (community.yml
and reports.json
, respectively), builds the site into the docs/
dir using jekyll, and then copies docs/
to the netlify branch.
Once this is all pushed, Netlify's GitHub "Continuous deployment" integration happens, which is configured in the deploy settings in Netlify.
-
Install a full Ruby development environment
-
Install Jekyll and Bundler
gem install jekyll gem install bundler -v 1.16.6
-
Install dependencies from Gemfile:
bundle install
-
Build the site and make it available on a local server
bundle exec jekyll serve
-
Browse to http://localhost:4000
- Run the Deploy Github action from the Actions tab.
The community file generation takes time and if you want to skip this step (this is anyways updated daily by the CI), you can run the action with the skip_gen
flag: when the dropdown menu appears after click "Run workflow", specify skip_gen
in the Arguments to deploy script
field, and click Run workflow
.