From fe5937dcaf92c31ca03cc73bdd9c6769f00bd020 Mon Sep 17 00:00:00 2001 From: Rogee Date: Wed, 26 Aug 2026 11:24:55 +0800 Subject: [PATCH 1/3] ci: route images by workflow host Co-authored-by: multica-agent --- .github/workflows/bridge-proxy.yml | 4 ++-- .github/workflows/docker-publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bridge-proxy.yml b/.github/workflows/bridge-proxy.yml index 74b2ca6..616dfb1 100644 --- a/.github/workflows/bridge-proxy.yml +++ b/.github/workflows/bridge-proxy.yml @@ -13,7 +13,7 @@ on: - .github/workflows/bridge-proxy.yml env: - REGISTRY: ghcr.io + REGISTRY: ${{ github.server_url == 'https://github.com' && 'ghcr.io' || 'git.ipao.vip' }} IMAGE_NAME: ${{ github.repository }}/bridge-proxy jobs: @@ -46,7 +46,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to GHCR + - name: Log in to container registry if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 61a9f23..4604b4b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -8,7 +8,7 @@ on: branches: [main, master] env: - REGISTRY: ghcr.io + REGISTRY: ${{ github.server_url == 'https://github.com' && 'ghcr.io' || 'git.ipao.vip' }} IMAGE_NAME: ${{ github.repository }} jobs: @@ -28,7 +28,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to GHCR + - name: Log in to container registry if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: -- 2.54.0 From 740267897dacfed014949d8f2516ad103d0ec675 Mon Sep 17 00:00:00 2001 From: Rogee Date: Wed, 26 Aug 2026 12:02:37 +0800 Subject: [PATCH 2/3] ci: use Gitea PAT for package push Co-authored-by: multica-agent --- .github/workflows/bridge-proxy.yml | 4 ++-- .github/workflows/docker-publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bridge-proxy.yml b/.github/workflows/bridge-proxy.yml index 616dfb1..464a821 100644 --- a/.github/workflows/bridge-proxy.yml +++ b/.github/workflows/bridge-proxy.yml @@ -51,8 +51,8 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.server_url == 'https://github.com' && github.actor || github.repository_owner }} + password: ${{ github.server_url == 'https://github.com' && secrets.GITHUB_TOKEN || secrets.PACKAGE_TOKEN }} - name: Extract metadata id: meta diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4604b4b..2028cf6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -33,8 +33,8 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.server_url == 'https://github.com' && github.actor || github.repository_owner }} + password: ${{ github.server_url == 'https://github.com' && secrets.GITHUB_TOKEN || secrets.PACKAGE_TOKEN }} - name: Extract metadata id: meta -- 2.54.0 From 383617284e6e3ac857e545c21de22004d7f52489 Mon Sep 17 00:00:00 2001 From: Rogee Date: Wed, 26 Aug 2026 15:16:21 +0800 Subject: [PATCH 3/3] ci: disable GHA cache on Gitea runners Co-authored-by: multica-agent --- .github/workflows/bridge-proxy.yml | 7 +++++-- .github/workflows/docker-publish.yml | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bridge-proxy.yml b/.github/workflows/bridge-proxy.yml index 464a821..18ac040 100644 --- a/.github/workflows/bridge-proxy.yml +++ b/.github/workflows/bridge-proxy.yml @@ -36,12 +36,15 @@ jobs: with: go-version-file: bridge-proxy/go.mod cache-dependency-path: bridge-proxy/go.mod + cache: ${{ github.server_url == 'https://github.com' }} - name: Test run: go test ./... - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + cache-image: ${{ github.server_url == 'https://github.com' }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -75,6 +78,6 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: ${{ github.server_url == 'https://github.com' && 'type=gha' || '' }} + cache-to: ${{ github.server_url == 'https://github.com' && 'type=gha,mode=max' || '' }} platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2028cf6..7ca1c93 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -24,6 +24,8 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + cache-image: ${{ github.server_url == 'https://github.com' }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -58,6 +60,6 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: ${{ github.server_url == 'https://github.com' && 'type=gha' || '' }} + cache-to: ${{ github.server_url == 'https://github.com' && 'type=gha,mode=max' || '' }} platforms: linux/amd64,linux/arm64 -- 2.54.0