fix(ci): consolidate crane steps and use password-stdin
This commit is contained in:
@@ -121,7 +121,7 @@ jobs:
|
||||
git clone --depth=1 --branch=${GITHUB_REF_NAME} ${REPO_URL}/${GITHUB_REPOSITORY}.git .
|
||||
git checkout ${GITHUB_SHA}
|
||||
|
||||
- name: Install crane and build images
|
||||
- name: Build and push images
|
||||
run: |
|
||||
# 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
|
||||
@@ -129,13 +129,15 @@ jobs:
|
||||
|
||||
BRANCH_TAG=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
|
||||
SHA_SHORT=$(echo ${GITHUB_SHA} | cut -c1-7)
|
||||
|
||||
# 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 }}
|
||||
# Debug
|
||||
echo "Registry: ${REGISTRY_HOST}"
|
||||
echo "Actor: ${GITHUB_ACTOR}"
|
||||
|
||||
# Login to Gitea container registry
|
||||
echo "${REGISTRY_PASSWORD}" | ./crane auth login --insecure ${REGISTRY_HOST} -u "${GITHUB_ACTOR}" --password-stdin
|
||||
|
||||
# Build and push web image
|
||||
docker build -f ./docker/Dockerfile.web -t mostovik-web:local .
|
||||
@@ -158,6 +160,8 @@ jobs:
|
||||
if [ "${GITHUB_REF_NAME}" = "main" ]; then
|
||||
./crane push --insecure /tmp/celery.tar ${REGISTRY}/mostovik-celery:latest
|
||||
fi
|
||||
env:
|
||||
REGISTRY_PASSWORD: ${{ gitea.token }}
|
||||
|
||||
- name: Image summary
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user