fix(ci): push images via internal Gitea registry
This commit is contained in:
@@ -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/adminpanel
|
IMAGE: gitea-http.gitea.svc.cluster.local:3000/sova/adminpanel
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@@ -48,10 +48,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: |
|
||||||
@@ -82,9 +80,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/adminpanel/values-${ENV}.yaml"
|
||||||
yq -i ".image.tag = \"${TAG}\"" "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 add "apps/adminpanel/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(adminpanel): bump ${ENV} to ${TAG}"
|
git commit -m "chore(adminpanel): bump ${ENV} to ${TAG}"
|
||||||
|
|||||||
Reference in New Issue
Block a user