fix: docker build

Update docker.yml
This commit is contained in:
xxnuo
2026-01-01 16:59:57 +08:00
parent 44d3828138
commit 103fdffdd4
4 changed files with 84 additions and 53 deletions

View File

@@ -44,7 +44,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
- name: Extract metadata (Standard)
id: meta
uses: docker/metadata-action@v5
with:
@@ -57,6 +57,19 @@ jobs:
type=semver,pattern={{major}},value=${{ steps.latest_tag.outputs.tag }}
type=raw,value=latest
- name: Extract metadata (Legacy)
id: meta-legacy
uses: docker/metadata-action@v5
with:
images: |
xxnuo/mtranserver
ghcr.io/xxnuo/mtranserver
tags: |
type=semver,pattern={{version}},value=${{ steps.latest_tag.outputs.tag }},suffix=-legacy
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_tag.outputs.tag }},suffix=-legacy
type=semver,pattern={{major}},value=${{ steps.latest_tag.outputs.tag }},suffix=-legacy
type=raw,value=legacy
- name: Get version
id: version
run: |
@@ -67,20 +80,7 @@ jobs:
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Build UI
run: |
cd ui
bun install --frozen-lockfile
bun run build
echo "✓ UI build complete"
ls -lh dist/
- name: Build and push Docker image
- name: Build and push (Standard - AVX2)
uses: docker/build-push-action@v5
with:
context: .
@@ -93,3 +93,18 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: Build and push (Legacy - No AVX2)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-legacy.outputs.tags }}
labels: ${{ steps.meta-legacy.outputs.labels }}
build-args: |
VERSION=${{ steps.version.outputs.version }}
BUILD_VARIANT=legacy
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false