Skip to content

Commit b0f91b5

Browse files
authored
Merge pull request #43 from cmu-delphi/update-and-archive-epicast
Update Crowdcast for containerization and archive status
2 parents 1ae0c86 + aaf754d commit b0f91b5

File tree

6 files changed

+645
-39
lines changed

6 files changed

+645
-39
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1+
name: CI
12
on:
2-
push
3-
4-
name: ci
5-
3+
pull_request:
4+
push:
65
jobs:
7-
build:
6+
build-tag-push-deploy:
87
runs-on: ubuntu-latest
8+
if: >
9+
github.ref == 'refs/heads/main' ||
10+
github.ref == 'refs/heads/dev'
911
steps:
10-
- uses: actions/checkout@v2
11-
with:
12-
# submodules: true # Fetch Hugo themes (true OR recursive)
13-
fetch-depth: 1
14-
12+
- name: Checkout code
13+
uses: actions/checkout@v2
1514
- name: Login to GitHub Container Registry
1615
uses: docker/login-action@v1
1716
with:
1817
registry: ghcr.io
1918
username: cmu-delphi-deploy-machine
2019
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
21-
22-
- name: Build, tag, and push image to Github
23-
env:
24-
DEVOPS_DOCKER_FILE: ./devops/Dockerfile
20+
- name: Build, tag, and push image to GitHub Container Registry
21+
id: image
2522
run: |
2623
baseRef="${GITHUB_REF#*/}"
2724
baseRef="${baseRef#*/}"
2825
case "${baseRef}" in
2926
main)
30-
imageTag="latest"
27+
image_tag="latest"
3128
;;
3229
*)
33-
imageTag="${baseRef//\//_}" # replace `/` with `_` in branch name
30+
image_tag="${baseRef//\//_}" # replace `/` with `_` in branch name
3431
;;
3532
esac
36-
echo "using tag: --${imageTag}--"
37-
docker build -t ghcr.io/${{ github.repository }}:$imageTag --file ${DEVOPS_DOCKER_FILE} .
38-
docker push ghcr.io/${{ github.repository }}:$imageTag
39-
40-
# trigger a webhook update
33+
cd ${{ github.workspace }}
34+
echo "using tag: --${image-tag}--"
35+
docker build -t ghcr.io/${{ github.repository }}:${image_tag} --file ./devops/Dockerfile .
36+
docker push ghcr.io/${{ github.repository }}:${image_tag}
37+
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_OUTPUT
38+
- name: Trigger smee.io webhook to deploy new container image
39+
run: |
4140
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
4241
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
4342
-H "Content-Type: application/x-www-form-urlencoded" \
44-
-d "repository=ghcr.io/${{ github.repository }}&tag=$imageTag"
43+
-d "repository=ghcr.io/${{ github.repository }}&tag=${{ steps.image.outputs.IMAGE_TAG }}"

README.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
1-
# Status
2-
3-
[![Deploy Status](https://delphi.midas.cs.cmu.edu/~automation/public/github_deploy_repo/badge.php?repo=cmu-delphi/www-epicast/dev)](#)
41

52
# About
63

7-
This is the **development** version of the website.
4+
The Crowdcast website for collecting flu forecasts. (Previously known as
5+
Epicast.)
6+
7+
The site is live at <https://delphi.cmu.edu/crowdcast>.
8+
9+
# Branches
10+
11+
The website is deployed to two separate environments: `staging` and `production`. The code for those environments is kept in the
12+
[`dev`](https://github.com/cmu-delphi/www-epicast/tree/dev) and
13+
[`main`](https://github.com/cmu-delphi/www-epicast/tree/main) branches,
14+
respectively.
15+
16+
## `dev` branch
17+
18+
The `dev` branch is deployed to a Delphi-internal development environment where we can iterate quickly without worry of breaking the production site.
19+
20+
## `main` branch
21+
22+
The `main` branch is deployed to a public-facing production environment. It
23+
should contain only tested and reliable code.
24+
25+
## Process
26+
27+
**`main` should not be updated while a forecasting round is active** (i.e.
28+
Friday through Monday), except in case of a critical bugfix.
29+
30+
Basic develop changes -> deploy/review in staging -> release to production workflow:
31+
32+
- Start by creating a **[bug|fix|feature|etc]** branch based on `dev`.
33+
- Make a PR and tag a reviewer with your changes against `dev`. Once apporved and merged this will trigger CI to deploy the application at https://staging.delphi.cmu.edu/crowdcast.
34+
- Once staging is reviewed and deemed acceptable, make a PR against `main` and tag a reviewer. Once this is approved and merged the production version of the application will be available at https://delphi.cmu.edu/crowdcast
835

9-
1. it is generally safe to make changes here at any time, as they will not
10-
affect the production environment
11-
2. changes should be merged from this branch into
12-
[the prod branch](https://github.com/cmu-delphi/www-epicast/tree/prod),
13-
except for production-specific configuration
36+
# Development
1437

15-
See
16-
[the master branch README.md](https://github.com/cmu-delphi/www-epicast/blob/master/README.md)
17-
for more information.
38+
For developing the website, see the
39+
[epicast development guide](docs/epicast_development.md).

site/common/header.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
2121
<script src="js/utils.js"></script>
2222
<script src="js/rAF.js"></script>
23-
<script src="https://delphi.cmu.edu/epidata/lib/delphi_epidata.js"></script>
23+
<script src="js/delphi_epidata.js"></script>
2424
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" media="none" onload="if(media!='all')media='all'" />
2525
<noscript>
2626
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" />
@@ -53,7 +53,11 @@
5353
<span class="effect_fluv">&lt;COVID-19 Edition&gt;</span>
5454
</a>
5555
</div>
56-
<div class="box_subtitle">Epidemiological Forecasting by <span class="effect_delphi"><a class="delphi" target="_blank" rel="noopener" href="https://delphi.cmu.edu/">DELPHI</a></span></div>
56+
<div class="box_subtitle">Epidemiological Forecasting by <span class="effect_delphi"><a class="delphi" target="_blank" rel="noopener" href="https://delphi.cmu.edu/">DELPHI</a></span>
57+
<br />
58+
<span class="effect_archive_index"> [ This site is in ARCHIVE mode and will not be updated or maintained!!! ]</span>
59+
</div>
60+
</div>
5761
</div>
5862
<?php
5963
if(!isset($skipLogin) || !$skipLogin) {
@@ -80,7 +84,7 @@
8084
?>
8185
<div class="box_header box_header_narrow box_header_fixed0"></div>
8286
<div class="box_header box_header_narrow box_header_fixed1">
83-
<div class="box_title box_title_mini"><span class="effect_delphi">Crowdcast</span>&nbsp;<span class="effect_fluv">COVID-19</span></div>
87+
<div class="box_title box_title_mini"><span class="effect_delphi">Crowdcast</span>&nbsp;<span class="effect_fluv">COVID-19</span>&nbsp;<span class="effect_archive_header"> [ This site is in ARCHIVE mode and will not be updated or maintained!!! ]</span></div>
8488
<div class="box_mininav">
8589
<span class="effect_tiny_header">Crowdcaster: <?= $output['user_name'] ?> [<?= $hash ?>]<br /></span>
8690
<?php

site/common/settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
$dbName = getenv('EPICAST_DB_NAME') ?: 'epicast2';
77

88
$epicastAdmin = array(
9-
"name" => "Brian Clark",
10-
"email" => "briancla@andrew.cmu.edu",
9+
"name" => "Delphi Support",
10+
"email" => "delphi-support+crowdcast@andrew.cmu.edu",
1111
);
1212
?>

site/css/style.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,19 @@
383383
span.effect_delphi {
384384
font-family: <?= $delphiFont ?>;
385385
}
386+
387+
span.effect_archive_header {
388+
font-family: <?= $delphiFont ?>;
389+
font-size: 0.5em;
390+
color: #c44;
391+
}
392+
393+
span.effect_archive_index {
394+
font-family: <?= $delphiFont ?>;
395+
font-size: 1em;
396+
color: #c44;
397+
}
398+
386399
span.effect_fluv {
387400
font-family: <?= $fluvFont ?>;
388401
font-style: italic;

0 commit comments

Comments
 (0)