mirror of
https://github.com/hanxi/xiaomusic.git
synced 2026-03-15 08:13:16 +08:00
优化镜像编译
This commit is contained in:
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -78,14 +78,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v')
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [amd64, arm64]
|
||||
include:
|
||||
- platform: amd64
|
||||
arch: amd64
|
||||
- platform: arm64
|
||||
arch: arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -101,28 +93,28 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Publish to Docker Hub (${{ matrix.platform }})
|
||||
- name: Publish to Docker Hub
|
||||
if: github.ref_name == 'main'
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.VERSION_TAG }}
|
||||
cache-from: type=gha,scope=${{ matrix.platform }}
|
||||
cache-from: type=gha
|
||||
|
||||
- name: Publish to Docker Hub latest and stable (${{ matrix.platform }})
|
||||
- name: Publish to Docker Hub latest and stable
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.VERSION_TAG }}
|
||||
${{ env.LATEST_TAG }}
|
||||
${{ env.STABLE_TAG }}
|
||||
cache-from: type=gha,scope=${{ matrix.platform }}
|
||||
cache-from: type=gha
|
||||
|
||||
# 推送镜像到 GitHub Release
|
||||
publish-release:
|
||||
|
||||
Reference in New Issue
Block a user