|
|
|
|
|
|
|
|
|
name: docker_publish
|
|
|
|
on:
|
|
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
docker-tag:
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
uses: jlumbroso/free-disk-space@main
|
|
with:
|
|
tool-cache: true
|
|
android: true
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: true
|
|
docker-images: true
|
|
swap-storage: true
|
|
|
|
- name: Docker meta:${{ github.ref_name }}
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/kohya-ss-gui
|
|
flavor: |
|
|
latest=auto
|
|
prefix=
|
|
suffix=
|
|
|
|
tags: |
|
|
type=semver,pattern=v{{major}}
|
|
type=semver,pattern={{raw}}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- 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.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
id: publish
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
target: final
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
VERSION=${{ github.ref_name }}
|
|
RELEASE=${{ github.run_number }}
|
|
platforms: linux/amd64
|
|
|
|
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/kohya-ss-gui:cache
|
|
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/kohya-ss-gui:cache,mode=max
|
|
sbom: true
|
|
provenance: true
|
|
|