From 5f20de8d6f647f31bfbbb330e1bbdbc3a739cda1 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Mon, 11 May 2026 07:51:50 +0000 Subject: [PATCH] Update .gitea/workflows/build-and-push.yaml --- .gitea/workflows/build-and-push.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml index a216944..5f0a1b4 100644 --- a/.gitea/workflows/build-and-push.yaml +++ b/.gitea/workflows/build-and-push.yaml @@ -16,7 +16,19 @@ jobs: steps: - name: Install tools run: | - apk add --no-cache git curl + apk add --no-cache git curl ca-certificates tar gzip + + case "$(uname -m)" in + x86_64) CRANE_ARCH="x86_64" ;; + aarch64) CRANE_ARCH="arm64" ;; + *) echo "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + + curl -fsSL \ + "https://github.com/google/go-containerregistry/releases/download/v0.20.3/go-containerregistry_Linux_${CRANE_ARCH}.tar.gz" \ + -o /tmp/go-containerregistry.tar.gz + tar -xzf /tmp/go-containerregistry.tar.gz -C /usr/local/bin crane + crane version - name: Checkout code run: | @@ -76,11 +88,12 @@ jobs: exit 1 fi - echo "${REGISTRY_TOKEN}" | docker login \ + echo "${REGISTRY_TOKEN}" | crane auth login --insecure \ "${{ steps.build.outputs.registry_host }}" \ --username "${REGISTRY_USERNAME}" \ --password-stdin - name: Push image run: | - docker push "${{ steps.build.outputs.image }}" \ No newline at end of file + docker save "${{ steps.build.outputs.image }}" -o image.tar + crane push --insecure image.tar "${{ steps.build.outputs.image }}" \ No newline at end of file