Add workflow

This commit is contained in:
Josh XT committed 2024-01-22 10:54:14 -05:00
1 parent ece55ffe06
commit 55799b2de8
2 files changed
+53 -1

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
name: Publish Docker image
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
jobs:
build_and_push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image_name: "python:3.11-slim"
gpu_type: "other"
platforms: "linux/amd64,linux/arm64/v8"
tag_name: "other"
- image_name: "nvidia/cuda:12.1.1-devel-ubuntu22.04"
gpu_type: "nvidia"
platforms: "linux/amd64"
tag_name: "cuda"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.platforms }}
push: true
tags: |
ghcr.io/josh-xt/alltalk_tts:${{ matrix.tag_name }}
ghcr.io/josh-xt/alltalk_tts:${{ matrix.tag_name }}-${{ github.sha }}
build-args: |
image_name=${{ matrix.image_name }}
gpu_type=${{ matrix.gpu_type }}