From b1fc34785063578647ba53e0cb0d5c06b885540a Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Sat, 28 Mar 2026 16:48:54 -0700 Subject: [PATCH] Publish registry image with skopeo --- .gitea/workflows/ci.yaml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index bfc3bf6..da466a7 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -32,24 +32,20 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Buildah + - name: Install Docker and Skopeo run: | apt-get update - apt-get install -y buildah - - - name: Login to Gitea Registry - env: - REGISTRY_HOST: ${{ vars.REGISTRY_HOST }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - run: | - printf '%s' "${REGISTRY_PASSWORD}" | buildah login --tls-verify=false -u "${GITHUB_REPOSITORY_OWNER}" --password-stdin "${REGISTRY_HOST}" + apt-get install -y docker.io skopeo - name: Build and Push Image env: REGISTRY_HOST: ${{ vars.REGISTRY_HOST }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} run: | - export BUILDAH_ISOLATION=chroot - image="${REGISTRY_HOST}/${GITHUB_REPOSITORY}" - buildah bud --storage-driver=vfs --format docker -t "${image}:main" -t "${image}:sha-${GITHUB_SHA}" . - buildah push --tls-verify=false "${image}:main" - buildah push --tls-verify=false "${image}:sha-${GITHUB_SHA}" + local_image="${GITHUB_REPOSITORY##*/}:ci" + archive="/tmp/${GITHUB_REPOSITORY##*/}.tar" + docker build -t "${local_image}" . + docker save "${local_image}" -o "${archive}" + for tag in main "sha-${GITHUB_SHA}"; do + skopeo copy --dest-creds "${GITHUB_REPOSITORY_OWNER}:${REGISTRY_PASSWORD}" --dest-tls-verify=false "docker-archive:${archive}" "docker://${REGISTRY_HOST}/${GITHUB_REPOSITORY}:${tag}" + done