Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Docker Publish

on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main
workflow_dispatch:
inputs:
tag:
description: 'Image tag (e.g., v1.0.0, latest, dev)'
required: false
default: 'dev'

permissions:
contents: read
packages: write

env:
REGISTRY: ghcr.io

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# CPU-only image (no GPU required)
- dockerfile: Dockerfile
image_name: scriberr
description: "Scriberr CPU-only (no GPU required)"
# CUDA image for GTX 10-series through RTX 40-series
- dockerfile: Dockerfile.cuda
image_name: scriberr-cuda
description: "Scriberr with CUDA 12.6 support (GTX 10-series through RTX 40-series)"
# Blackwell CUDA image for RTX 50-series
- dockerfile: Dockerfile.cuda.12.9
image_name: scriberr-cuda-blackwell
description: "Scriberr with CUDA 12.9 support (RTX 50-series Blackwell)"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image_name }}
tags: |
# Tag with version for releases (v1.0.0 -> 1.0.0)
type=semver,pattern={{version}}
# Tag with major.minor for releases (v1.0.0 -> 1.0)
type=semver,pattern={{major}}.{{minor}}
# Tag with 'latest' for releases
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
# Tag with 'dev' for main branch pushes
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }}
# Tag with manual input if workflow_dispatch
type=raw,value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
# Tag with short SHA
type=sha,prefix=sha-
labels: |
org.opencontainers.image.title=${{ matrix.image_name }}
org.opencontainers.image.description=${{ matrix.description }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64

- name: Output image info
run: |
echo "### ${{ matrix.image_name }}" >> $GITHUB_STEP_SUMMARY
echo "Tags:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion docker-compose.cuda.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
scriberr:
image: ghcr.io/rishikanthc/scriberr:v1.0.4-cuda
image: ghcr.io/rishikanthc/scriberr-cuda:latest
ports:
- "8080:8080"
volumes:
Expand Down
Loading