Skip to content

Commit eb28cc2

Browse files
committed
Merge remote-tracking branch 'origin/dev' into sgratzl/covidcast-dev
2 parents c756ffe + d20a7c0 commit eb28cc2

File tree

133 files changed

+268217
-8067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+268217
-8067
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
${{ runner.os }}-conda6-
2525
- uses: conda-incubator/setup-miniconda@v2
2626
with:
27-
python-version: 3.7
27+
python-version: 3.9
2828
mamba-version: "*"
2929
channels: conda-forge,defaults
3030
channel-priority: true
@@ -46,14 +46,22 @@ jobs:
4646
with:
4747
path: |
4848
./blogdown
49-
key: ${{ runner.os }}-blogdown2-${{ hashFiles('content/blog/**.Rmd') }}
49+
key: ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-${{ hashFiles('content/blog/**.Rmd') }}
5050
restore-keys: |
51+
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
5152
${{ runner.os }}-blogdown2-
5253
- name: Build site
5354
shell: bash -l {0}
5455
run: |
5556
npm run build:blog
5657
58+
- uses: actions/upload-artifact@v2
59+
with:
60+
name: blog
61+
path: |
62+
./content/blog
63+
./static/blog
64+
5765
- uses: actions/setup-node@v1
5866
with:
5967
node-version: "12"

.github/workflows/ci_fast.yaml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,36 @@ jobs:
3535
with:
3636
name: website
3737
path: ./public
38-
39-
- name: Configure AWS credentials
40-
uses: aws-actions/configure-aws-credentials@v1
41-
with:
42-
aws-access-key-id: ${{ secrets.DELPHI_ECR_ACCESS_ID }}
43-
aws-secret-access-key: ${{ secrets.DELPHI_ECR_ACCESS_KEY }}
44-
aws-region: us-east-1
4538

46-
- name: Login to Amazon ECR
47-
id: login-ecr
48-
uses: aws-actions/amazon-ecr-login@v1
39+
- name: Login to GitHub Container Registry
40+
if: (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/release') && github.event_name == 'push'
41+
uses: docker/login-action@v1
42+
with:
43+
registry: ghcr.io
44+
username: cmu-delphi-deploy-machine
45+
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
4946

50-
- name: Build, tag, and push image to Amazon ECR
47+
- name: Build, tag, and push image to Github
48+
if: (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/release') && github.event_name == 'push'
5149
env:
52-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
53-
ECR_REPOSITORY: ${{ github.event.repository.name }}
50+
DEVOPS_DOCKER_FILE: ./devops/precompiled.dockerfile
5451
run: |
5552
baseRef="${GITHUB_REF#*/}"
5653
baseRef="${baseRef#*/}"
5754
case "${baseRef}" in
5855
main)
59-
awsTag="latest"
56+
imageTag="latest"
6057
;;
6158
*)
62-
awsTag="${baseRef//\//_}" # replace `/` with `_` in branch name
59+
imageTag="${baseRef//\//_}" # replace `/` with `_` in branch name
6360
;;
6461
esac
65-
echo "using tag: --${awsTag}--"
66-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag --file ./devops/precompiled/Dockerfile .
67-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag
62+
echo "using tag: --${imageTag}--"
63+
docker build -t ghcr.io/${{ github.repository }}:$imageTag --file ${DEVOPS_DOCKER_FILE} .
64+
docker push ghcr.io/${{ github.repository }}:$imageTag
6865
6966
# trigger a webhook update
7067
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
7168
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
7269
-H "Content-Type: application/x-www-form-urlencoded" \
73-
-d "repository=$ECR_REGISTRY/$ECR_REPOSITORY&tag=$awsTag"
70+
-d "repository=ghcr.io/${{ github.repository }}&tag=$imageTag"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
/assets/jsconfig.json
1212
/static/uikit/**
1313
.DS_Store
14+
*.zip
15+
*.tgz

.gitpod.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
image:
2+
file: ./devops/gitpod.dockerfile
3+
tasks:
4+
- init: npm install && RScript -e "blogdown::install_hugo()"
5+
- command: 'echo ''run: "npm start" or "npm run start:blog"'''
6+
ports:
7+
- port: 1313
8+
vscode:
9+
extensions:
10+
- [email protected]:SrD06skfmg05hLAerl2aKQ==

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@
2929
*.md
3030
*.jpeg
3131
*.ico
32-
/themes/delphi/layouts/partials/webp-image.html
32+
*.bib
33+
/themes/delphi/layouts/partials/webp-image.html
34+
/themes/delphi/layouts/shortcodes/apireflink.html
35+
/themes/delphi/layouts/shortcodes/reflink.html

.release-it.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"hooks": {
3+
"before:init": "npm run lint",
4+
"before:release": "npm run build && npm run zip",
5+
"after:release": "echo Successfully released ${name} v${version}."
6+
},
7+
"git": {
8+
"tagName": "v${version}"
9+
},
10+
"npm": {
11+
"publish": false
12+
},
13+
"github": {
14+
"release": true,
15+
"assets": ["website.zip"]
16+
}
17+
}

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Delphi Website
22

3+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/cmu-delpih/www-main)
4+
5+
36
Delphi's homepage at https://cmu-delphi-main.netlify.app/
47

58
This site is based on [Hugo](https://gohugo.io) and uses [Prettier](https://prettier.io) for formatting.
@@ -38,9 +41,9 @@ In RMarkdown things are slightly more different since the R Markdown parser is u
3841
**Examples**
3942

4043
```
41-
[Facebook](`r blogdown::shortcode_html("ref", "2020-08-26-fb-survey")`)
42-
[previous exploratory investigations](`r blogdown::shortcode_html("ref", "2020-08-26-fb-survey#some-interesting-examples")`)
43-
[public API](`r blogdown::shortcode_html("apiref", "api/covidcast.html")`)
44+
`r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey", "Facebook")`
45+
`r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey#some-interesting-examples", "previous exploratory investigations")`
46+
`r blogdown::shortcode_html("apireflink", "api/covidcast.html", "public API")`
4447
4548
```
4649

@@ -53,6 +56,8 @@ In addition, there in the `/data` directory there are the following listings in
5356

5457
## Development Environment
5558

59+
One click: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/cmu-delpih/www-main)
60+
5661
### Web Editor Only
5762

5863
1. Install Node: https://nodejs.org/en/download/
@@ -86,6 +91,7 @@ In order to convert the Rmd files to HTML files for Hugo you also need to:
8691
- `local=TRUE` similar to `-D` to process draft files
8792
- `run_hugo=FALSE` to manually run hugo
8893
- `build_rmd=TRUE` force a (re)build of the Rmd pages
94+
1. Run blogdown to convert a single file to HTML: `Rscript -e 'blogdown::build_site(local=TRUE, run_hugo=FALSE, build_rmd="content/blog/<NAME>.Rmd")'`
8995
1. Alternatively, run `npm run build:blog`
9096
1. Run Hugo server as usual
9197

@@ -98,3 +104,16 @@ In case you use new dependencies don't forget to either edit `environment.yml` o
98104
A Github action should runs when Rmd files changes so it will verify that the blog post can be built.
99105
However, the converted HTML file along with all generated images are committed to the repository.
100106
This simplifies the deployment and ensures that we have a blog post even when the API or data changes.
107+
108+
109+
### Release Process
110+
111+
The release process is based on [release-it](https://github.com/release-it/release-it). To create a release, run
112+
113+
1. create/checkout the release branch `release` and push to origin
114+
1. run `npm run release` and publish the release
115+
1. create a PR that merges the `release` branch in the `main` branch
116+
1. create a PR that merges the `main` branch back into the `dev` branch
117+
118+
Then go to the release page and update short description of the changes made.
119+

config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,9 @@ relativeURLs = false
111111
mission = "Develop the theory and practice of epidemiological forecasting, with a long-term vision of making this technology as universally accepted and useful as weather forecasting is today."
112112
apiUrl = "https://cmu-delphi.github.io/delphi-epidata"
113113
twitter = "CmuDelphi"
114+
feedbackForm = "https://docs.google.com/forms/d/e/1FAIpQLSeIeOJtrAhdOriEyiRY7LkpQX8DZBY19dl6De8l56Q9CZhmxw/viewform?usp=pp_url&entry.1245962748="
115+
feedbackLikelihoodMobile = 0.2
116+
feedbackLikelihoodDesktop = 1
117+
feedbackDelayMin = 45 # in sec
118+
feedbackDelayMax = 180 # in sec
119+
feedbackDuration = 60 # show it for 60sec

content/about/team/index.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ team:
219219
note: Core member, May–July 2020
220220
team:
221221
- contributors
222+
- firstName: Sangwon (Justin)
223+
lastName: Hyun
224+
image: sangwon-justin-hyun-500x500-min.jpg
225+
affiliation: USC
226+
team:
227+
- contributors
228+
note: Core member, March–May 2020
222229
- firstName: Jimi
223230
lastName: Kim
224231
image: jimi-kim-500x500-min.jpg
@@ -293,6 +300,13 @@ team:
293300
team:
294301
- past
295302
note: Core member, March–April 2020
303+
- firstName: David
304+
lastName: Farrow
305+
image: david-farrow_head-shot.jpg
306+
affiliation: Software Engineer
307+
team:
308+
- past
309+
note: Founding member 2012–2016, Core member March–April 2020, Google Fellow October–December 2020
296310
- firstName: EJ
297311
lastName: Fox
298312
image: ej-fox-500x500-min.jpg
@@ -314,13 +328,6 @@ team:
314328
team:
315329
- past
316330
notes: Intern, summer 2020
317-
- firstName: Sangwon (Justin)
318-
lastName: Hyun
319-
image: sangwon-justin-hyun-500x500-min.jpg
320-
affiliation: USC
321-
team:
322-
- past
323-
note: Core member, March–May 2020; Contributor, May–July 2020
324331
- firstName: Jaemin
325332
lastName: Jo
326333
image: jaemin-jo-500x500-min.jpg
@@ -456,13 +463,6 @@ team:
456463
affiliation: Software Engineer
457464
team:
458465
- google
459-
- firstName: David
460-
lastName: Farrow
461-
image: david-farrow_head-shot.jpg
462-
affiliation: Software Engineer
463-
team:
464-
- google
465-
note: Founding member 2012–2016, Core member March–April 2020
466466
- firstName: Shreenath
467467
lastName: Regunathan
468468
image: shreenath-regunathan-head-shot.jpg

content/blog/2015-07-23-template-post.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ tags:
99
draft: true # remove this line in new blog posts
1010
authors: # list of author keys, see /data/authors.yaml
1111
- frida
12-
heroImage: /blog/images/blog-lg-img_hello-world.jpg
13-
heroImageThumb: /blog/images/blog-thumb-img_hello-world.jpg
12+
heroImage: /blog/images/blog-lg-img_hello-world.jpg # size: 1120x440 jpg and webp format
13+
heroImageThumb: /blog/images/blog-thumb-img_hello-world.jpg # size: 300x200 jpg and webp format
1414
summary: |
1515
Blog summary, the first 150 characters are used for the blog list
1616
acknowledgements: |
@@ -110,12 +110,12 @@ suggest we consider the following tags as base tags:
110110

111111
### Linking to other pages and blog posts:
112112

113-
using the file name and the Hugo shortcodes, e.g.: [Facebook Post](`r blogdown::shortcode_html("relref", "2020-08-26-fb-survey")`).
113+
using the file name and the Hugo shortcodes, e.g.: `r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey", "Facebook Post")`.
114114
Jumping to a specific section/anchor is supported too:
115-
[previous exploratory investigations](`r blogdown::shortcode_html("relref", "2020-08-26-fb-survey#some-interesting-examples")`)
115+
`r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey#some-interesting-examples", "previous exploratory investigations")`
116116

117117
### Linking to the API doc:
118118

119119
there is another shortcode for creating an api link, e.g.
120-
[public API](`r blogdown::shortcode_html("apiref", "/")`) or
121-
[Doctor's Visits signal](`r blogdown::shortcode_html("apiref", "api/covidcast-signals/doctor-visits.html")`)
120+
`r blogdown::shortcode_html("apireflink", "/", "public API")` or
121+
`r blogdown::shortcode_html("apireflink", "api/covidcast-signals/doctor-visits.html", "Doctor's Visits signal")`

0 commit comments

Comments
 (0)