From d2ffc96308f46ea8d7bd5bee8ea363cbebe88191 Mon Sep 17 00:00:00 2001 From: sova-ci Date: Tue, 9 Jun 2026 16:25:49 +0300 Subject: [PATCH] ci: sed bump deploy values, fix adminpanel Dockerfile env.js --- .gitea/workflows/build.yml | 17 +++++++---------- Dockerfile | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 66f398b..6f6226e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -81,18 +81,15 @@ jobs: git config user.email "ci-bot@sova.local" git config user.name "sova-ci" MAX_RETRIES=5 - case "$(uname -m)" in - x86_64|amd64) YQ_ARCH=amd64 ;; - aarch64|arm64) YQ_ARCH=arm64 ;; - *) echo "Unsupported arch: $(uname -m)"; exit 1 ;; - esac - curl -sSL -o /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_${YQ_ARCH}" - chmod +x /usr/local/bin/yq + bump_values() { + local file="apps/adminpanel/values-${ENV}.yaml" + sed -i "s|^ repository:.*| repository: ${IMAGE_DEPLOY}|" "$file" + sed -i "s|^ tag:.*| tag: ${TAG}|" "$file" + sed -i "s|^ pullPolicy:.*| pullPolicy: IfNotPresent|" "$file" + } for attempt in $(seq 1 $MAX_RETRIES); do git pull --rebase origin "${ENV}" - yq -i ".image.repository = \"${IMAGE_DEPLOY}\"" "apps/adminpanel/values-${ENV}.yaml" - yq -i ".image.tag = \"${TAG}\"" "apps/adminpanel/values-${ENV}.yaml" - yq -i ".image.pullPolicy = \"IfNotPresent\"" "apps/adminpanel/values-${ENV}.yaml" + bump_values git add "apps/adminpanel/values-${ENV}.yaml" git diff --cached --quiet && { echo "No changes"; exit 0; } git commit -m "chore(adminpanel): bump ${ENV} to ${TAG}" diff --git a/Dockerfile b/Dockerfile index e474971..eb5d0f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN npm run build FROM nginx:1.27-alpine AS runtime COPY docker/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/dist /usr/share/nginx/html -COPY public/env.js /usr/share/nginx/html/env.js +RUN echo 'window.__ENV__ = window.__ENV__ || {};' > /usr/share/nginx/html/env.js COPY docker/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh EXPOSE 80