-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (77 loc) · 2.52 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
name: Build and push images for stable diffusion use-case
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '!samples/stable-diffusion/**'
- '!.github/**'
workflow_dispatch:
inputs:
imageTag:
description: "container image tag"
required: false
default: latest
type: string
workflow_call:
inputs:
imageTag:
description: "container image tag"
required: false
default: latest
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
with:
swap-size-mb: 2048
remove-dotnet: 'true'
remove-android: 'true'
- name: Checkout code
uses: actions/checkout@v4
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: kedify
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Cosign
uses: sigstore/cosign-installer@v3
- name: Install Syft
uses: anchore/sbom-action@v0
with:
format: 'spdx-json'
output-file: ${{ matrix.makefileTarget }}-${{ github.run_number }}-${{ github.run_attempt }}-'sbom.spdx.json'
- 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 }}"
run: |
cd samples/stable-diffusion/
make ${{ matrix.makefileTarget }}