-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (82 loc) · 3.11 KB
/
stable-diff-images.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build and push images for stable diffusion use-case
on:
workflow_dispatch:
inputs:
imageTag:
description: "container image tag"
required: false
default: latest
type: string
skipWorker:
description: "should the build for worker image be skipped"
required: false
default: 'true'
type: string
workflow_call:
inputs:
imageTag:
description: "container image tag"
required: false
default: latest
type: string
skipWorker:
description: "should the build for worker image be skipped"
required: false
default: 'true'
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CONTAINER_IMG_REGISTRY: ghcr.io
CONTAINER_IMG_ORG: kedify
CONTAINER_IMG_WORKER_NAME: stable-diffusion-worker
CONTAINER_IMG_WEBUI_NAME: stable-diffusion-webui
CONTAINER_IMG_TAG: ${{ inputs.imageTag || 'latest' }}
jobs:
build-container:
permissions:
contents: write
packages: write # push images
id-token: write # needed for signing the images with GitHub OIDC Token
name: build container
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
makefileTarget: [build-webui-image-multiarch, build-stable-diff-image-multiarch]
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
if: matrix.makefileTarget == 'build-stable-diff-image-multiarch' && inputs.skipWorker != 'true'
with:
overprovision-lvm: 'true'
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout code
uses: actions/checkout@v4
if: matrix.makefileTarget != 'build-stable-diff-image-multiarch' || inputs.skipWorker != 'true'
- name: Login to ghcr.io
uses: docker/login-action@v3
if: matrix.makefileTarget != 'build-stable-diff-image-multiarch' || inputs.skipWorker != 'true'
with:
registry: ghcr.io
username: kedify
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: matrix.makefileTarget != 'build-stable-diff-image-multiarch' || inputs.skipWorker != 'true'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: matrix.makefileTarget != 'build-stable-diff-image-multiarch' || inputs.skipWorker != 'true'
- name: Build and push
env:
WORKER_IMAGE: "${{ env.CONTAINER_IMG_REGISTRY }}/${{ env.CONTAINER_IMG_ORG }}/${{ env.CONTAINER_IMG_WORKER_NAME }}:${{ env.CONTAINER_IMG_TAG }}"
WEBUI_IMAGE: "${{ env.CONTAINER_IMG_REGISTRY }}/${{ env.CONTAINER_IMG_ORG }}/${{ env.CONTAINER_IMG_WEBUI_NAME }}:${{ env.CONTAINER_IMG_TAG }}"
if: matrix.makefileTarget != 'build-stable-diff-image-multiarch' || inputs.skipWorker != 'true'
run: |
cd samples/stable-diffusion/
make ${{ matrix.makefileTarget }}