diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d817fdf33..d3bc05543 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -36,6 +36,9 @@ jobs: script: | set -e # Exit immediately if a command fails + # Check if helm chart exists + helm status ${{ inputs.name }} &>/dev/null && status=true || status=false + # Upgrade helm chart, or install if not exists helm upgrade ${{ inputs.name }} oci://registry-1.docker.io/octoberkeleytime/bt-app \ --install \ @@ -43,6 +46,12 @@ jobs: --namespace=bt \ --values <(echo "${{ inputs.values }}") + # Restart deployment if helm chart existed + if [ $status = true ]; then + kubectl rollout restart deployment ${{ inputs.name }}-backend + kubectl rollout restart deployment ${{ inputs.name }}-frontend + fi + # Check container status kubectl rollout status --timeout=180s deployment ${{ inputs.name }}-backend kubectl rollout status --timeout=180s deployment ${{ inputs.name }}-frontend diff --git a/infra/app/templates/_helpers.tpl b/infra/app/templates/_helpers.tpl index 9fd3683d1..9d6354d01 100644 --- a/infra/app/templates/_helpers.tpl +++ b/infra/app/templates/_helpers.tpl @@ -12,11 +12,6 @@ Labels applied to all resources. helm.sh/chart: {{ include "bt-app.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} -{{/* -the timestamp label forces a rolling update when the value is changed. necessary since -we do not change the chart or image version when deploying. -*/}} -timestamp: {{ date "2006-01-02_15.04.05Z" (now) | quote }} env: {{ .Values.env }} {{- end -}}