fix(ci): use domain name for Gitea container registry
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Successful in 1m52s
CI/CD Pipeline / Run Tests (push) Successful in 2m3s
CI/CD Pipeline / Build Docker Images (push) Successful in 2s
CI/CD Pipeline / Push to Gitea Registry (push) Failing after 7s

This commit is contained in:
2026-02-02 14:03:10 +01:00
parent 97111afbd1
commit 04d9e6bf40

View File

@@ -123,21 +123,24 @@ jobs:
- name: Install crane and build images
run: |
# Install crane for pushing to insecure HTTP registry
# Install crane for pushing to Gitea container registry
curl -sL https://github.com/google/go-containerregistry/releases/download/v0.19.0/go-containerregistry_Linux_x86_64.tar.gz | tar xz crane
chmod +x crane
BRANCH_TAG=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
SHA_SHORT=$(echo ${GITHUB_SHA} | cut -c1-7)
# Gitea container registry is on HTTP at 10.10.0.10:3000
REGISTRY="10.10.0.10:3000/${{ github.repository_owner }}"
# Build web image locally
# Gitea redirects auth to domain name, so use it everywhere
REGISTRY_HOST="git.dev.nii-ecos.ru"
REGISTRY="${REGISTRY_HOST}/${{ github.repository_owner }}"
# Login to Gitea container registry (--insecure for self-signed cert)
./crane auth login --insecure ${REGISTRY_HOST} -u ${{ gitea.actor }} -p ${{ gitea.token }}
# Build and push web image
docker build -f ./docker/Dockerfile.web -t mostovik-web:local .
docker save mostovik-web:local -o /tmp/web.tar
# Push with crane (supports insecure HTTP)
./crane auth login --insecure 10.10.0.10:3000 -u ${{ gitea.actor }} -p ${{ gitea.token }}
./crane push --insecure /tmp/web.tar ${REGISTRY}/mostovik-web:${BRANCH_TAG}
./crane push --insecure /tmp/web.tar ${REGISTRY}/mostovik-web:${BRANCH_TAG}-${SHA_SHORT}
@@ -145,7 +148,7 @@ jobs:
./crane push --insecure /tmp/web.tar ${REGISTRY}/mostovik-web:latest
fi
# Build celery image locally
# Build and push celery image
docker build -f ./docker/Dockerfile.celery -t mostovik-celery:local .
docker save mostovik-celery:local -o /tmp/celery.tar
@@ -158,4 +161,4 @@ jobs:
- name: Image summary
run: |
echo "Images pushed to 10.10.0.10:3000/${{ github.repository_owner }}/"
echo "Images pushed to git.dev.nii-ecos.ru/${{ github.repository_owner }}/"