Use Buildah for registry publishing
CI / test (push) Successful in 28s
CI / publish (push) Failing after 21s

This commit is contained in:
Joe Julian
2026-03-28 16:46:56 -07:00
parent a1147dd6c1
commit 2ef915b37a
2 changed files with 5 additions and 23 deletions
+4 -18
View File
@@ -40,30 +40,16 @@ jobs:
- name: Login to Gitea Registry
env:
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
REGISTRY_PUSH_HOST: ${{ vars.REGISTRY_PUSH_HOST }}
REGISTRY_INSECURE: ${{ vars.REGISTRY_INSECURE }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
push_host="${REGISTRY_PUSH_HOST:-${REGISTRY_HOST}}"
tls_verify=true
if [ "${REGISTRY_INSECURE}" = "true" ]; then
tls_verify=false
fi
printf '%s' "${REGISTRY_PASSWORD}" | buildah login --tls-verify="${tls_verify}" -u "${GITHUB_REPOSITORY_OWNER}" --password-stdin "${push_host}"
printf '%s' "${REGISTRY_PASSWORD}" | buildah login --tls-verify=false -u "${GITHUB_REPOSITORY_OWNER}" --password-stdin "${REGISTRY_HOST}"
- name: Build and Push Image
env:
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
REGISTRY_PUSH_HOST: ${{ vars.REGISTRY_PUSH_HOST }}
REGISTRY_INSECURE: ${{ vars.REGISTRY_INSECURE }}
run: |
push_host="${REGISTRY_PUSH_HOST:-${REGISTRY_HOST}}"
tls_verify=true
if [ "${REGISTRY_INSECURE}" = "true" ]; then
tls_verify=false
fi
export BUILDAH_ISOLATION=chroot
image="${push_host}/${GITHUB_REPOSITORY}"
image="${REGISTRY_HOST}/${GITHUB_REPOSITORY}"
buildah bud --storage-driver=vfs --format docker -t "${image}:main" -t "${image}:sha-${GITHUB_SHA}" .
buildah push --tls-verify="${tls_verify}" "${image}:main"
buildah push --tls-verify="${tls_verify}" "${image}:sha-${GITHUB_SHA}"
buildah push --tls-verify=false "${image}:main"
buildah push --tls-verify=false "${image}:sha-${GITHUB_SHA}"