From 13fbd6cb0aef8e1523385a68bb9fd1fd40911398 Mon Sep 17 00:00:00 2001 From: XyLearningProgramming Date: Mon, 21 Jul 2025 12:48:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20added=20a=20slug=20env=20for?= =?UTF-8?q?=20codecov?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e9eba8..63c3098 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,8 @@ jobs: flags: unittests name: codecov-umbrella fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} + slug: XyLearningProgramming/slm_server - name: Lint with ruff run: | From 6cef2d2a2f9e4aa7b2e5d1068be4a7d8fc99e099 Mon Sep 17 00:00:00 2001 From: XyLearningProgramming Date: Mon, 21 Jul 2025 14:35:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20trying=20to=20fix=20tag=20er?= =?UTF-8?q?ror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 10 +++++++++- deploy/helm/templates/deployment.yaml | 4 +++- deploy/helm/values.yaml | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6ff5431..300ca67 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 "tag=$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/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 a9c461e..1b8a746 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -97,3 +97,6 @@ probes: timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 + +strategy: + type: Recreate