HH-685: route workflow images by host #2

Merged
rogee merged 3 commits from agent/hh-685-gitea-registry into main 2026-08-26 17:12:00 +08:00
2 changed files with 17 additions and 12 deletions
+9 -6
View File
@@ -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:
@@ -36,23 +36,26 @@ 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
- name: Log in to GHCR
- name: Log in to container registry
if: github.event_name != 'pull_request'
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
@@ -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
+8 -6
View File
@@ -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:
@@ -24,17 +24,19 @@ 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
- name: Log in to GHCR
- name: Log in to container registry
if: github.event_name != 'pull_request'
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
@@ -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