Skip to content

Update Crowdcast for containerization and archive status #43

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

Merged
merged 30 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b7abda5
Update JS client URL
korlaxxalrok Jul 12, 2023
a2dffbf
Use local JS client
korlaxxalrok Jul 12, 2023
16d9e79
Switch from briancla to delphi+crowdcast email address
korlaxxalrok Jul 12, 2023
adfc57c
Test for header mod
korlaxxalrok Jul 12, 2023
8ee2aef
Fix tag closure
korlaxxalrok Jul 12, 2023
59781c2
Remove bracket
korlaxxalrok Jul 12, 2023
6497089
Try some 'this is archived' verbiage
korlaxxalrok Jul 12, 2023
1af609d
Revise text
korlaxxalrok Jul 13, 2023
163b3f4
Add CSS block to make some smallish red text
korlaxxalrok Jul 13, 2023
eef741e
Use new effect in span
korlaxxalrok Jul 13, 2023
ee0a3d0
Slight text update
korlaxxalrok Jul 13, 2023
2370eb6
Update CI to run on dev and main
korlaxxalrok Jul 13, 2023
6738978
TEST: Build on update-and-archive-epicast branch
korlaxxalrok Jul 13, 2023
a02e463
Fix CI
korlaxxalrok Jul 13, 2023
34feb24
Fix indentation
korlaxxalrok Jul 13, 2023
ec7238d
Use correct ref path
korlaxxalrok Jul 13, 2023
b48299e
Move Dockerfile to project root, remove devops dir
korlaxxalrok Jul 13, 2023
889d25d
Ok move it back
korlaxxalrok Jul 13, 2023
7dcc14e
Use Dockerfile at devops path in CI
korlaxxalrok Jul 13, 2023
5751a09
Really fix Dockerfile path in CI
korlaxxalrok Jul 13, 2023
5b8b377
Update style, add text to index page
korlaxxalrok Jul 14, 2023
0849d73
Reduce size
korlaxxalrok Jul 14, 2023
d49c121
Change size
korlaxxalrok Jul 14, 2023
b3af612
New effects, make text sizes different
korlaxxalrok Jul 14, 2023
da3c34d
Fix type, really add effects
korlaxxalrok Jul 14, 2023
1748a8b
Make the archive warning a bit more dramatic
korlaxxalrok Jul 14, 2023
e5acf66
Update readme
korlaxxalrok Jul 19, 2023
74d8819
Remove branch from CI
korlaxxalrok Jul 20, 2023
32599cc
Slight verbiage change
korlaxxalrok Jul 20, 2023
aaf754d
Update support email address
korlaxxalrok Jul 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
name: CI
on:
push

name: ci

pull_request:
push:
jobs:
build:
build-tag-push-deploy:
runs-on: ubuntu-latest
if: >
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/dev'
steps:
- uses: actions/checkout@v2
with:
# submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 1

- name: Checkout code
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: cmu-delphi-deploy-machine
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}

- name: Build, tag, and push image to Github
env:
DEVOPS_DOCKER_FILE: ./devops/Dockerfile
- name: Build, tag, and push image to GitHub Container Registry
id: image
run: |
baseRef="${GITHUB_REF#*/}"
baseRef="${baseRef#*/}"
case "${baseRef}" in
main)
imageTag="latest"
image_tag="latest"
;;
*)
imageTag="${baseRef//\//_}" # replace `/` with `_` in branch name
image_tag="${baseRef//\//_}" # replace `/` with `_` in branch name
;;
esac
echo "using tag: --${imageTag}--"
docker build -t ghcr.io/${{ github.repository }}:$imageTag --file ${DEVOPS_DOCKER_FILE} .
docker push ghcr.io/${{ github.repository }}:$imageTag

# trigger a webhook update
cd ${{ github.workspace }}
echo "using tag: --${image-tag}--"
docker build -t ghcr.io/${{ github.repository }}:${image_tag} --file ./devops/Dockerfile .
docker push ghcr.io/${{ github.repository }}:${image_tag}
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_OUTPUT
- name: Trigger smee.io webhook to deploy new container image
run: |
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "repository=ghcr.io/${{ github.repository }}&tag=$imageTag"
-d "repository=ghcr.io/${{ github.repository }}&tag=${{ steps.image.outputs.IMAGE_TAG }}"
46 changes: 34 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
# Status

[![Deploy Status](https://delphi.midas.cs.cmu.edu/~automation/public/github_deploy_repo/badge.php?repo=cmu-delphi/www-epicast/dev)](#)

# About

This is the **development** version of the website.
The Crowdcast website for collecting flu forecasts. (Previously known as
Epicast.)

The site is live at <https://delphi.cmu.edu/crowdcast>.

# Branches

The website is deployed to two separate environments: `staging` and `production`. The code for those environments is kept in the
[`dev`](https://github.com/cmu-delphi/www-epicast/tree/dev) and
[`main`](https://github.com/cmu-delphi/www-epicast/tree/main) branches,
respectively.

## `dev` branch

The `dev` branch is deployed to a Delphi-internal development environment where we can iterate quickly without worry of breaking the production site.

## `main` branch

The `main` branch is deployed to a public-facing production environment. It
should contain only tested and reliable code.

## Process

**`main` should not be updated while a forecasting round is active** (i.e.
Friday through Monday), except in case of a critical bugfix.

Basic develop changes -> deploy/review in staging -> release to production workflow:

- Start by creating a **[bug|fix|feature|etc]** branch based on `dev`.
- 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.
- 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

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

See
[the master branch README.md](https://github.com/cmu-delphi/www-epicast/blob/master/README.md)
for more information.
For developing the website, see the
[epicast development guide](docs/epicast_development.md).
10 changes: 7 additions & 3 deletions site/common/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="js/utils.js"></script>
<script src="js/rAF.js"></script>
<script src="https://delphi.cmu.edu/epidata/lib/delphi_epidata.js"></script>
<script src="js/delphi_epidata.js"></script>
<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'" />
<noscript>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" />
Expand Down Expand Up @@ -53,7 +53,11 @@
<span class="effect_fluv">&lt;COVID-19 Edition&gt;</span>
</a>
</div>
<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>
<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>
<br />
<span class="effect_archive_index"> [ This site is in ARCHIVE mode and will not be updated or maintained!!! ]</span>
</div>
</div>
</div>
<?php
if(!isset($skipLogin) || !$skipLogin) {
Expand All @@ -80,7 +84,7 @@
?>
<div class="box_header box_header_narrow box_header_fixed0"></div>
<div class="box_header box_header_narrow box_header_fixed1">
<div class="box_title box_title_mini"><span class="effect_delphi">Crowdcast</span>&nbsp;<span class="effect_fluv">COVID-19</span></div>
<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>
<div class="box_mininav">
<span class="effect_tiny_header">Crowdcaster: <?= $output['user_name'] ?> [<?= $hash ?>]<br /></span>
<?php
Expand Down
4 changes: 2 additions & 2 deletions site/common/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$dbName = getenv('EPICAST_DB_NAME') ?: 'epicast2';

$epicastAdmin = array(
"name" => "Brian Clark",
"email" => "briancla@andrew.cmu.edu",
"name" => "Delphi Support",
"email" => "delphi+crowdcast@andrew.cmu.edu",
);
?>
13 changes: 13 additions & 0 deletions site/css/style.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,19 @@
span.effect_delphi {
font-family: <?= $delphiFont ?>;
}

span.effect_archive_header {
font-family: <?= $delphiFont ?>;
font-size: 0.5em;
color: #c44;
}

span.effect_archive_index {
font-family: <?= $delphiFont ?>;
font-size: 1em;
color: #c44;
}

span.effect_fluv {
font-family: <?= $fluvFont ?>;
font-style: italic;
Expand Down
Loading