fix(ci): push images via internal Gitea registry
This commit is contained in:
@@ -8,8 +8,8 @@ on:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
REGISTRY: git.sova.local
|
||||
IMAGE: git.sova.local/sova/adminpanel
|
||||
REGISTRY: gitea-http.gitea.svc.cluster.local:3000
|
||||
IMAGE: gitea-http.gitea.svc.cluster.local:3000/sova/adminpanel
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -48,10 +48,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Docker login
|
||||
env:
|
||||
HOST_IP: ${{ secrets.HOST_IP }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
echo "${HOST_IP} git.sova.local" | tee -a /etc/hosts
|
||||
echo "${REGISTRY_PASSWORD}" | docker login "$REGISTRY" -u sova-ci --password-stdin
|
||||
- name: Build and push
|
||||
run: |
|
||||
@@ -82,9 +80,13 @@ jobs:
|
||||
git config user.email "ci-bot@sova.local"
|
||||
git config user.name "sova-ci"
|
||||
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
|
||||
git pull --rebase origin main
|
||||
yq -i ".image.repository = \"${IMAGE}\"" "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"
|
||||
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}"
|
||||
|
||||
Reference in New Issue
Block a user