fix(ci): use domain name for Gitea container registry
This commit is contained in:
@@ -123,21 +123,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Install crane and build images
|
- name: Install crane and build images
|
||||||
run: |
|
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
|
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
|
chmod +x crane
|
||||||
|
|
||||||
BRANCH_TAG=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
|
BRANCH_TAG=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
|
||||||
SHA_SHORT=$(echo ${GITHUB_SHA} | cut -c1-7)
|
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 build -f ./docker/Dockerfile.web -t mostovik-web:local .
|
||||||
docker save mostovik-web:local -o /tmp/web.tar
|
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}
|
||||||
./crane push --insecure /tmp/web.tar ${REGISTRY}/mostovik-web:${BRANCH_TAG}-${SHA_SHORT}
|
./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
|
./crane push --insecure /tmp/web.tar ${REGISTRY}/mostovik-web:latest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build celery image locally
|
# Build and push celery image
|
||||||
docker build -f ./docker/Dockerfile.celery -t mostovik-celery:local .
|
docker build -f ./docker/Dockerfile.celery -t mostovik-celery:local .
|
||||||
docker save mostovik-celery:local -o /tmp/celery.tar
|
docker save mostovik-celery:local -o /tmp/celery.tar
|
||||||
|
|
||||||
@@ -158,4 +161,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Image summary
|
- name: Image summary
|
||||||
run: |
|
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 }}/"
|
||||||
|
|||||||
Reference in New Issue
Block a user