Skip to content

Commit 2c0a656

Browse files
authored
add staff dashboard to cicd (#1028)
1 parent 3d09e62 commit 2c0a656

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/cd-deploy.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
description: "Helm chart override values (yaml)"
2424
required: true
2525
type: string
26+
deploy_staff:
27+
description: "Deploy staff dashboard (prod only)"
28+
required: true
29+
type: boolean
30+
default: false
2631

2732
jobs:
2833
deploy:
@@ -58,10 +63,35 @@ jobs:
5863
kubectl rollout restart deployment ${{ inputs.name }}-frontend
5964
fi
6065
66+
# Deploy staff dashboard if requested
67+
if [ "${{ inputs.deploy_staff }}" = "true" ]; then
68+
echo "Deploying staff dashboard..."
69+
70+
# Check if staff helm chart exists
71+
helm status ${{ inputs.name }}-staff &>/dev/null && staff_status=true || staff_status=false
72+
73+
# Upgrade staff helm chart, or install if not exists
74+
helm upgrade ${{ inputs.name }}-staff oci://registry-1.docker.io/octoberkeleytime/bt-staff \
75+
--install \
76+
--version=${{ inputs.version }} \
77+
--namespace=bt
78+
79+
# Restart deployment if helm chart existed
80+
if [ $staff_status = true ]; then
81+
kubectl rollout restart deployment ${{ inputs.name }}-staff-frontend
82+
fi
83+
84+
# Check container status
85+
kubectl rollout status --timeout=300s deployment ${{ inputs.name }}-staff-frontend
86+
fi
87+
6188
# Check container status
6289
kubectl rollout status --timeout=300s deployment ${{ inputs.name }}-backend
6390
kubectl rollout status --timeout=300s deployment ${{ inputs.name }}-frontend
6491
6592
- name: Output Summary
6693
run: |
6794
echo "# :white_check_mark: Deployment available at [${{ inputs.host }}](https://${{ inputs.host }})." >> $GITHUB_STEP_SUMMARY
95+
if [ "${{ inputs.deploy_staff }}" = "true" ]; then
96+
echo "# :white_check_mark: Staff dashboard available at [staff.berkeleytime.com](https://staff.berkeleytime.com)." >> $GITHUB_STEP_SUMMARY
97+
fi

.github/workflows/cd-prod.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: "CD: Deploy to Production"
2-
run-name: "Deployed `${{ github.sha }}`"
2+
run-name: "Deployed `${{ github.sha }}`${{ inputs.deploy_staff && ' with staff dashboard' || '' }}"
33

44
concurrency: production
55

66
on:
77
workflow_dispatch:
8+
inputs:
9+
deploy_staff:
10+
description: "Deploy staff dashboard"
11+
required: true
12+
type: boolean
13+
default: false
814

915
jobs:
1016
branch-check:
@@ -36,4 +42,5 @@ jobs:
3642
values: |
3743
host: berkeleytime.com
3844
host: berkeleytime.com
45+
deploy_staff: ${{ inputs.deploy_staff }}
3946
secrets: inherit

0 commit comments

Comments
 (0)