Add multi build
This commit is contained in:
1 parent
d008c7ab0a
commit
f089e3e85b
3 files changed
+49
-15
No files matched your search
@@ -10,6 +10,15 @@ on:
|
||||
jobs:
|
||||
build_and_push:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- dockerfile: "./Dockerfile"
|
||||
platforms: "linux/amd64,linux/arm64/v8"
|
||||
tag_name: "cpu"
|
||||
- dockerfile: "./nvidia.Dockerfile"
|
||||
platforms: "linux/amd64"
|
||||
tag_name: "cuda"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -24,13 +33,28 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: vars.DOCKERHUB_USERNAME != ''
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: "linux/amd64"
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: ${{ matrix.platforms }}
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/josh-xt/alltalk_tts:latest
|
||||
ghcr.io/josh-xt/alltalk_tts:main-${{ github.sha }}
|
||||
ghcr.io/${{ github.actor }}/alltalk_tts:${{ matrix.tag_name }}-${{ github.sha }}
|
||||
ghcr.io/${{ github.actor }}/alltalk_tts:${{ matrix.tag_name }}
|
||||
|
||||
- name: Docker Hub Description
|
||||
if: vars.DOCKERHUB_USERNAME != ''
|
||||
uses: peter-evans/dockerhub-description@v3.4.2
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: ${{ vars.DOCKERHUB_USERNAME }}/alltalk_tts
|
||||
Reference in new issue
Block a user