fix(ci): push images via internal Gitea registry

This commit is contained in:
sova-ci
2026-05-28 01:03:38 +03:00
parent 391fa6625f
commit 460cd08511
+6 -4
View File
@@ -8,8 +8,8 @@ on:
branches: [main] branches: [main]
env: env:
REGISTRY: git.sova.local REGISTRY: gitea-http.gitea.svc.cluster.local:3000
IMAGE: git.sova.local/sova/backend IMAGE: gitea-http.gitea.svc.cluster.local:3000/sova/backend
jobs: jobs:
test: test:
@@ -55,10 +55,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Docker login - name: Docker login
env: env:
HOST_IP: ${{ secrets.HOST_IP }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: | run: |
echo "${HOST_IP} git.sova.local" | tee -a /etc/hosts
echo "${REGISTRY_PASSWORD}" | docker login "$REGISTRY" -u sova-ci --password-stdin echo "${REGISTRY_PASSWORD}" | docker login "$REGISTRY" -u sova-ci --password-stdin
- name: Build and push - name: Build and push
run: | run: |
@@ -89,9 +87,13 @@ jobs:
git config user.email "ci-bot@sova.local" git config user.email "ci-bot@sova.local"
git config user.name "sova-ci" git config user.name "sova-ci"
MAX_RETRIES=5 MAX_RETRIES=5
curl -sSL -o /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64
chmod +x /usr/local/bin/yq
for attempt in $(seq 1 $MAX_RETRIES); do for attempt in $(seq 1 $MAX_RETRIES); do
git pull --rebase origin main git pull --rebase origin main
yq -i ".image.repository = \"${IMAGE}\"" "apps/backend/values-${ENV}.yaml"
yq -i ".image.tag = \"${TAG}\"" "apps/backend/values-${ENV}.yaml" yq -i ".image.tag = \"${TAG}\"" "apps/backend/values-${ENV}.yaml"
yq -i ".image.pullPolicy = \"IfNotPresent\"" "apps/backend/values-${ENV}.yaml"
git add "apps/backend/values-${ENV}.yaml" git add "apps/backend/values-${ENV}.yaml"
git diff --cached --quiet && { echo "No changes"; exit 0; } git diff --cached --quiet && { echo "No changes"; exit 0; }
git commit -m "chore(backend): bump ${ENV} to ${TAG}" git commit -m "chore(backend): bump ${ENV} to ${TAG}"