build-linux-image.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Build Image
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest-16c64g
  9. steps:
  10. - uses: actions/checkout@v4
  11. - uses: docker/setup-qemu-action@v3
  12. - uses: docker/setup-buildx-action@v3
  13. - name: Get Version
  14. run: |
  15. echo "version=$(basename ${GITHUB_REF})" >> $GITHUB_ENV
  16. - name: Login to GitHub Container Registry
  17. uses: docker/login-action@v3
  18. with:
  19. registry: ghcr.io
  20. username: ${{ github.repository_owner }}
  21. password: ${{ secrets.GITHUB_TOKEN }}
  22. - name: Build and Push Image
  23. uses: docker/build-push-action@v6
  24. with:
  25. context: .
  26. file: Dockerfile
  27. platforms: linux/amd64,linux/arm64
  28. push: true
  29. tags: |
  30. ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.version }}
  31. ghcr.io/${{ github.repository_owner }}/fish-speech:latest
  32. outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
  33. cache-from: type=gha
  34. cache-to: type=gha,mode=max
  35. - name: Build and Push Debug Image
  36. uses: docker/build-push-action@v6
  37. with:
  38. context: .
  39. file: Dockerfile-debug
  40. platforms: linux/amd64,linux/arm64
  41. push: true
  42. build-args: |
  43. VERSION=${{ env.version }}
  44. BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.version }}
  45. tags: |
  46. ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.version }}-debug
  47. outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
  48. cache-from: type=gha
  49. cache-to: type=gha,mode=max