|
@@ -1,4 +1,4 @@
|
|
|
-name: Build Image
|
|
|
|
|
|
|
+name: Build Docker Images
|
|
|
|
|
|
|
|
on:
|
|
on:
|
|
|
push:
|
|
push:
|
|
@@ -10,10 +10,16 @@ on:
|
|
|
jobs:
|
|
jobs:
|
|
|
build:
|
|
build:
|
|
|
runs-on: ubuntu-latest-16c64g
|
|
runs-on: ubuntu-latest-16c64g
|
|
|
|
|
+ strategy:
|
|
|
|
|
+ matrix:
|
|
|
|
|
+ target: [webui, server]
|
|
|
|
|
+ backend: [cuda, cpu]
|
|
|
steps:
|
|
steps:
|
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/checkout@v4
|
|
|
|
|
+
|
|
|
- name: Set up Docker Buildx
|
|
- name: Set up Docker Buildx
|
|
|
uses: docker/setup-buildx-action@v3
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
+
|
|
|
- name: Get Version
|
|
- name: Get Version
|
|
|
run: |
|
|
run: |
|
|
|
if [[ $GITHUB_REF == refs/tags/v* ]]; then
|
|
if [[ $GITHUB_REF == refs/tags/v* ]]; then
|
|
@@ -21,7 +27,6 @@ jobs:
|
|
|
else
|
|
else
|
|
|
version=nightly
|
|
version=nightly
|
|
|
fi
|
|
fi
|
|
|
-
|
|
|
|
|
echo "version=${version}" >> $GITHUB_ENV
|
|
echo "version=${version}" >> $GITHUB_ENV
|
|
|
echo "Current version: ${version}"
|
|
echo "Current version: ${version}"
|
|
|
|
|
|
|
@@ -31,37 +36,38 @@ jobs:
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
password: ${{ secrets.DOCKER_PAT }}
|
|
password: ${{ secrets.DOCKER_PAT }}
|
|
|
|
|
|
|
|
- - name: Build and Push Image
|
|
|
|
|
- uses: docker/build-push-action@v6
|
|
|
|
|
- with:
|
|
|
|
|
- context: .
|
|
|
|
|
- file: dockerfile
|
|
|
|
|
- platforms: linux/amd64
|
|
|
|
|
- push: true
|
|
|
|
|
- tags: |
|
|
|
|
|
- fishaudio/fish-speech:${{ env.version }}
|
|
|
|
|
- fishaudio/fish-speech:latest
|
|
|
|
|
- outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
|
|
|
|
- cache-from: type=registry,ref=fishaudio/fish-speech:latest
|
|
|
|
|
- cache-to: type=inline
|
|
|
|
|
|
|
+ - name: Set platform for CPU builds
|
|
|
|
|
+ id: platform
|
|
|
|
|
+ run: |
|
|
|
|
|
+ if [ "${{ matrix.backend }}" = "cpu" ]; then
|
|
|
|
|
+ echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
|
|
|
|
|
+ else
|
|
|
|
|
+ echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- - name: Build and Push Dev Image
|
|
|
|
|
|
|
+ - name: Build and Push ${{ matrix.target }}-${{ matrix.backend }} Image
|
|
|
uses: docker/build-push-action@v6
|
|
uses: docker/build-push-action@v6
|
|
|
with:
|
|
with:
|
|
|
context: .
|
|
context: .
|
|
|
- file: dockerfile.dev
|
|
|
|
|
- platforms: linux/amd64
|
|
|
|
|
|
|
+ file: docker/Dockerfile
|
|
|
|
|
+ platforms: ${{ steps.platform.outputs.platforms }}
|
|
|
push: true
|
|
push: true
|
|
|
|
|
+ target: ${{ matrix.target }}
|
|
|
build-args: |
|
|
build-args: |
|
|
|
- VERSION=${{ env.version }}
|
|
|
|
|
- BASE_IMAGE=fishaudio/fish-speech:${{ env.version }}
|
|
|
|
|
|
|
+ BACKEND=${{ matrix.backend }}
|
|
|
|
|
+ UV_EXTRA=${{ matrix.backend == 'cuda' && 'cu126' || 'cpu' }}
|
|
|
tags: |
|
|
tags: |
|
|
|
- fishaudio/fish-speech:${{ env.version }}-dev
|
|
|
|
|
- fishaudio/fish-speech:latest-dev
|
|
|
|
|
|
|
+ fishaudio/fish-speech-${{ matrix.target }}:${{ env.version }}-${{ matrix.backend }}
|
|
|
|
|
+ fishaudio/fish-speech-${{ matrix.target }}:latest-${{ matrix.backend }}
|
|
|
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
|
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
|
|
- cache-from: type=registry,ref=fishaudio/fish-speech:latest-dev
|
|
|
|
|
|
|
+ cache-from: type=registry,ref=fishaudio/fish-speech-${{ matrix.target }}:latest-${{ matrix.backend }}
|
|
|
cache-to: type=inline
|
|
cache-to: type=inline
|
|
|
|
|
|
|
|
|
|
+ update-readme:
|
|
|
|
|
+ runs-on: ubuntu-latest
|
|
|
|
|
+ needs: build
|
|
|
|
|
+ if: github.ref == 'refs/heads/main'
|
|
|
|
|
+ steps:
|
|
|
- name: Push README to Dockerhub
|
|
- name: Push README to Dockerhub
|
|
|
uses: peter-evans/dockerhub-description@v4
|
|
uses: peter-evans/dockerhub-description@v4
|
|
|
with:
|
|
with:
|