11name : Docker Build and Push
22
33on :
4- push :
5- branches :
6- - main
7- - v3-preview
8- tags :
9- - ' v*'
104 release :
115 types : [published]
12- pull_request :
13- branches :
14- - main
15- - v3-preview
166
177env :
188 REGISTRY_DOCKERHUB : docker.io
@@ -38,14 +28,12 @@ jobs:
3828 driver : docker-container
3929
4030 - name : Login to Docker Hub
41- if : github.event_name != 'pull_request'
4231 uses : docker/login-action@v3
4332 with :
4433 username : ${{ secrets.DOCKERHUB_USERNAME }}
4534 password : ${{ secrets.DOCKERHUB_TOKEN }}
4635
4736 - name : Login to GitHub Container Registry
48- if : github.event_name != 'pull_request'
4937 uses : docker/login-action@v3
5038 with :
5139 registry : ${{ env.REGISTRY_GHCR }}
@@ -60,36 +48,31 @@ jobs:
6048 ${{ secrets.DOCKERHUB_USERNAME }}/ttsfm
6149 ${{ env.REGISTRY_GHCR }}/${{ env.IMAGE_NAME }}
6250 tags : |
63- type=ref,event=branch
64- type=ref,event=pr
6551 type=ref,event=tag
6652 type=semver,pattern={{version}}
6753 type=semver,pattern={{major}}.{{minor}}
6854 type=semver,pattern={{major}}
69- type=raw,value=latest,enable={{is_default_branch}}
55+ type=raw,value=latest
7056 labels : |
7157 org.opencontainers.image.source=${{ github.repositoryUrl }}
7258 org.opencontainers.image.description=Free TTS API server compatible with OpenAI's TTS API format using openai.fm
7359 org.opencontainers.image.licenses=MIT
7460 org.opencontainers.image.title=TTSFM - Free TTS API Server
75- org.opencontainers.image.vendor=TTSFM Team
61+ org.opencontainers.image.vendor=dbcccc
7662
7763 - name : Build and push
7864 id : build-and-push
7965 uses : docker/build-push-action@v5
8066 with :
8167 context : .
8268 platforms : linux/amd64,linux/arm64
83- push : ${{ github.event_name != 'pull_request' }}
69+ push : true
8470 tags : ${{ steps.meta.outputs.tags }}
8571 labels : ${{ steps.meta.outputs.labels }}
8672 cache-from : type=gha
8773 cache-to : type=gha,mode=max
8874
89-
90-
9175 - name : Show image info
92- if : github.event_name != 'pull_request'
9376 run : |
9477 echo "Pushed tags: ${{ steps.meta.outputs.tags }}"
9578 echo "Image digest: ${{ steps.build-and-push.outputs.digest }}"
0 commit comments