diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ad14bf0..3053171 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -66,10 +66,18 @@ jobs: type=gha,mode=max type=registry,ref=${{ secrets.REGISTRY_REPOSITORY }}:buildcache,mode=max + - name: Extract SHA-suffixed tag + id: extract_tag + run: | + # Find the tag with SHA suffix (format: branch-sha) + TAGS='${{ steps.meta.outputs.tags }}' + SHA_TAG=$(echo "$TAGS" | grep -E '.*-[a-f0-9]{7}$' | head -1 | cut -d':' -f2) + echo $SHA_TAG >> $GITHUB_OUTPUT + - name: Deploy with Helm uses: ./.github/actions/helm-deploy with: - image_tag: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} + image_tag: ${{ steps.extract_tag.outputs.tag }} registry_repository: ${{ secrets.REGISTRY_REPOSITORY }} kube_config_data: ${{ secrets.KUBE_CONFIG_DATA }} helm_values_env: ${{ secrets.HELM_VALUES_ENV }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0e5a68..1617854 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: flags: unittests fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} + slug: XyLearningProgramming/slm_server - name: Lint with ruff run: | diff --git a/deploy/helm/templates/deployment.yaml b/deploy/helm/templates/deployment.yaml index f77662d..bd0b995 100644 --- a/deploy/helm/templates/deployment.yaml +++ b/deploy/helm/templates/deployment.yaml @@ -81,4 +81,6 @@ spec: - name: scripts configMap: name: {{ include "slm-server.fullname" . }}-scripts - defaultMode: 0755 \ No newline at end of file + defaultMode: 0755 + strategy: + {{- toYaml .Values.strategy | nindent 4 }} diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index 890f6e8..2211e4c 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -105,3 +105,6 @@ probes: timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 + +strategy: + type: Recreate