fix: push via internal Gitea HTTP registry with insecure-registries

This commit is contained in:
luochen570
2026-07-15 00:13:25 +08:00
parent 4498dc720c
commit e34185bfc3

View File

@@ -12,6 +12,8 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
env:
GITEA_REGISTRY: gitea-http.gitea.svc.cluster.local:3000
steps:
- name: Checkout
run: |
@@ -29,29 +31,17 @@ jobs:
docker buildx create --use --driver docker-container --name builder 2>/dev/null || true
docker buildx inspect --bootstrap
- name: Build image (multi-arch, export to daemon)
- name: Login to internal Gitea Container Registry
run: |
echo "${{ secrets.CHECKOUT_TOKEN }}" | \
docker login "${GITEA_REGISTRY}" -u luochen570 --password-stdin
- name: Build and push (multi-arch, via internal registry)
run: |
TAG_WEEKLY="weekly-$(date +%Y%m%d)"
docker buildx build \
--platform linux/amd64,linux/arm64 \
--load \
-t luochen570-cli:latest \
--push \
-t "${GITEA_REGISTRY}/luochen570/luochen570-cli:latest" \
-t "${GITEA_REGISTRY}/luochen570/luochen570-cli:${TAG_WEEKLY}" \
.
- name: Install skopeo
run: |
apt-get update -qq && apt-get install -y -qq skopeo
- name: Push to Gitea internal registry (via skopeo, bypass Traefik)
run: |
GITEA_INTERNAL="gitea-http.gitea.svc.cluster.local:3000"
TAG_WEEKLY="weekly-$(date +%Y%m%d)"
skopeo copy \
docker-daemon:luochen570-cli:latest \
"docker://${GITEA_INTERNAL}/luochen570/luochen570-cli:latest" \
--dest-creds="luochen570:${{ secrets.CHECKOUT_TOKEN }}" \
--dest-tls-verify=false
skopeo copy \
docker-daemon:luochen570-cli:latest \
"docker://${GITEA_INTERNAL}/luochen570/luochen570-cli:${TAG_WEEKLY}" \
--dest-creds="luochen570:${{ secrets.CHECKOUT_TOKEN }}" \
--dest-tls-verify=false