build-dev.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Build Dev Image
  2. on:
  3. push:
  4. branches:
  5. - main
  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. version=dev
  16. full_version=${version}-$(date "+%Y%m%d")
  17. echo "version=${version}" >> $GITHUB_ENV
  18. echo "full_version=${full_version}" >> $GITHUB_ENV
  19. - name: Login to GitHub Container Registry
  20. uses: docker/login-action@v3
  21. with:
  22. registry: ghcr.io
  23. username: ${{ github.repository_owner }}
  24. password: ${{ secrets.GITHUB_TOKEN }}
  25. - name: Build and Push Image
  26. uses: docker/build-push-action@v6
  27. with:
  28. context: .
  29. file: Dockerfile
  30. platforms: linux/amd64,linux/arm64
  31. push: true
  32. tags: |
  33. ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.version }}
  34. outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
  35. cache-from: type=gha
  36. cache-to: type=gha,mode=max
  37. - name: Build and Push Debug Image
  38. uses: docker/build-push-action@v6
  39. with:
  40. context: .
  41. file: Dockerfile-debug
  42. platforms: linux/amd64,linux/arm64
  43. push: true
  44. build-args: |
  45. VERSION=${{ env.version }}
  46. BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.version }}
  47. tags: |
  48. ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.version }}-debug
  49. ghcr.io/${{ github.repository_owner }}/fish-speech:${{ env.full_version }}
  50. outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
  51. cache-from: type=gha
  52. cache-to: type=gha,mode=max