Skip to content

Commit 3dba73a

Browse files
authored
refactor(ci): organize workflow into push-triggered QA and manual docker builds
Updated CI workflow to restrict branches for push events and improved input descriptions for image selection and push options.
1 parent 28117dc commit 3dba73a

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ name: CI
22

33
on:
44
push:
5-
branches: [master, dev]
5+
branches: [master]
66
workflow_dispatch:
77
inputs:
88
image:
9-
description: "Which image to build?"
9+
description: "Which image to build? (cpp=C++ engine, cpu=PyTorch CPU, cuda=PyTorch CUDA, all=all three)"
1010
required: true
1111
type: choice
1212
options:
1313
- cpp
1414
- cpu
1515
- cuda
1616
- all
17-
push:
17+
push_image:
1818
description: "Push to ghcr.io?"
1919
required: true
2020
default: "true"
@@ -27,6 +27,7 @@ env:
2727

2828
jobs:
2929

30+
3031
file-integrity:
3132
name: File integrity
3233
if: github.event_name == 'push'
@@ -86,8 +87,9 @@ jobs:
8687
run: ./quadtrix --help || true
8788

8889

90+
8991
build-cpp-image:
90-
name: Build — cpp
92+
name: "Build — cpp (C++ engine · linux/amd64 + arm64)"
9193
if: github.event_name == 'workflow_dispatch' && (inputs.image == 'cpp' || inputs.image == 'all')
9294
runs-on: ubuntu-latest
9395
permissions:
@@ -100,7 +102,7 @@ jobs:
100102
- uses: docker/setup-buildx-action@v3
101103

102104
- name: Login to GHCR
103-
if: inputs.push == 'true'
105+
if: inputs.push_image == 'true'
104106
uses: docker/login-action@v3
105107
with:
106108
registry: ${{ env.REGISTRY }}
@@ -123,15 +125,15 @@ jobs:
123125
context: .
124126
file: .devops/Dockerfile.cpp
125127
platforms: linux/amd64,linux/arm64
126-
push: ${{ inputs.push == 'true' }}
128+
push: ${{ inputs.push_image == 'true' }}
127129
tags: ${{ steps.meta.outputs.tags }}
128130
labels: ${{ steps.meta.outputs.labels }}
129131
cache-from: type=gha,scope=cpp
130132
cache-to: type=gha,mode=max,scope=cpp
131133

132134

133135
build-cpu-image:
134-
name: Build — cpu
136+
name: "Build — cpu (PyTorch CPU · linux/amd64 + arm64)"
135137
if: github.event_name == 'workflow_dispatch' && (inputs.image == 'cpu' || inputs.image == 'all')
136138
runs-on: ubuntu-latest
137139
permissions:
@@ -144,7 +146,7 @@ jobs:
144146
- uses: docker/setup-buildx-action@v3
145147

146148
- name: Login to GHCR
147-
if: inputs.push == 'true'
149+
if: inputs.push_image == 'true'
148150
uses: docker/login-action@v3
149151
with:
150152
registry: ${{ env.REGISTRY }}
@@ -167,15 +169,15 @@ jobs:
167169
context: .
168170
file: .devops/Dockerfile
169171
platforms: linux/amd64,linux/arm64
170-
push: ${{ inputs.push == 'true' }}
172+
push: ${{ inputs.push_image == 'true' }}
171173
tags: ${{ steps.meta.outputs.tags }}
172174
labels: ${{ steps.meta.outputs.labels }}
173175
cache-from: type=gha,scope=cpu
174176
cache-to: type=gha,mode=max,scope=cpu
175177

176178

177179
build-cuda-image:
178-
name: Build — cuda
180+
name: "Build — cuda (PyTorch CUDA · linux/amd64 only)"
179181
if: github.event_name == 'workflow_dispatch' && (inputs.image == 'cuda' || inputs.image == 'all')
180182
runs-on: ubuntu-latest
181183
permissions:
@@ -187,7 +189,7 @@ jobs:
187189
- uses: docker/setup-buildx-action@v3
188190

189191
- name: Login to GHCR
190-
if: inputs.push == 'true'
192+
if: inputs.push_image == 'true'
191193
uses: docker/login-action@v3
192194
with:
193195
registry: ${{ env.REGISTRY }}
@@ -210,8 +212,8 @@ jobs:
210212
context: .
211213
file: .devops/Dockerfile.backend
212214
platforms: linux/amd64
213-
push: ${{ inputs.push == 'true' }}
215+
push: ${{ inputs.push_image == 'true' }}
214216
tags: ${{ steps.meta.outputs.tags }}
215217
labels: ${{ steps.meta.outputs.labels }}
216218
cache-from: type=gha,scope=cuda
217-
cache-to: type=gha,mode=max,scope=cuda
219+
cache-to: type=gha,mode=max,scope=cuda

0 commit comments

Comments
 (0)