Skip to content

Commit

Permalink
feat: add gha workflow for building and pushing docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedir Zadniprovskyi committed May 26, 2024
1 parent aada575 commit aa5390b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ flake.lock
.task
Taskfile.yaml
README.md
.secrets
.ruff_cache
51 changes: 51 additions & 0 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: docker-build-and-push

on:
push:
branches:
- "master"
# TODO: releases

jobs:
docker:
runs-on: ubuntu-22.04
strategy:
matrix:
dockerfile: [Dockerfile.cuda, Dockerfile.cpu]
include:
- dockerfile: Dockerfile.cuda
tag-prefix: cuda
- repository-name: Dockerfile.cpu
tag-prefix: cpu
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: |
fedirz/speaches
# https://github.com/docker/metadata-action?tab=readme-ov-file#flavor-input
flavor: |
latest=false
prefix=${{ matrix.tag-prefix }}
tags: |
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
# push: true
# TODO: multi-platform
# platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
# TODO: cache
# cache-from: type=registry,ref=fedirz/speaches:buildcache
# cache-to: type=registry,ref=fedirz/speaches:buildcache,mode=max
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ __pycache__
tests/data
.direnv
.task
.secrets
.ruff_cache
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(with python311Packages; huggingface-hub)
act
ffmpeg-full
go-task
lsyncd
Expand Down

0 comments on commit aa5390b

Please sign in to comment.