-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (73 loc) · 2.56 KB
/
Copy pathbuild_docker.yml
File metadata and controls
82 lines (73 loc) · 2.56 KB
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
# C2C Farm backend image — CI template.
# Builds the full-ComfyUI farm image (renderfarm/docker/Dockerfile + the
# pinned custom_nodes_manifest.txt) and pushes to ACR and/or ECR.
#
# TEMPLATE: wire the secrets below in repo settings before enabling.
# ACR: ACR_LOGIN_SERVER, ACR_USERNAME, ACR_PASSWORD
# ECR: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, ECR_REPOSITORY
# Runs on manual dispatch (images are ~20GB — don't build per-push).
name: build-c2c-farm-backend-image
on:
workflow_dispatch:
inputs:
comfyui_ref:
description: "ComfyUI git ref to bake"
default: "master"
required: true
image_tag:
description: "Image tag"
default: "latest"
required: true
push_acr:
description: "Push to Azure Container Registry"
type: boolean
default: true
push_ecr:
description: "Push to AWS ECR"
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Login to ACR
if: ${{ inputs.push_acr }}
uses: docker/login-action@v3
with:
registry: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Configure AWS credentials
if: ${{ inputs.push_ecr }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to ECR
if: ${{ inputs.push_ecr }}
id: ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Compute tags
id: tags
run: |
TAGS=""
if [ "${{ inputs.push_acr }}" = "true" ]; then
TAGS="${{ secrets.ACR_LOGIN_SERVER }}/comfy-c2c-farm-backend:${{ inputs.image_tag }}"
fi
if [ "${{ inputs.push_ecr }}" = "true" ]; then
[ -n "$TAGS" ] && TAGS="$TAGS,"
TAGS="$TAGS${{ steps.ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY }}:${{ inputs.image_tag }}"
fi
echo "tags=$TAGS" >> "$GITHUB_OUTPUT"
- name: Build & push
uses: docker/build-push-action@v6
with:
context: .
file: renderfarm/docker/Dockerfile
push: true
tags: ${{ steps.tags.outputs.tags }}
build-args: |
COMFYUI_REF=${{ inputs.comfyui_ref }}