Skip to content

Commit 3d7c534

Browse files
authored
ci: Add Docker build workflow to test all image variants
2 parents 2ce3e0c + 0ac093e commit 3d7c534

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/build_docker.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build CCExtractor Docker Images
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- '.github/workflows/build_docker.yml'
8+
- 'docker/**'
9+
- '**.c'
10+
- '**.h'
11+
- 'src/rust/**'
12+
pull_request:
13+
types: [opened, synchronize, reopened]
14+
paths:
15+
- '.github/workflows/build_docker.yml'
16+
- 'docker/**'
17+
- '**.c'
18+
- '**.h'
19+
- 'src/rust/**'
20+
21+
jobs:
22+
build_minimal:
23+
name: Docker build (minimal)
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v6
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
- name: Build minimal image
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: .
33+
file: docker/Dockerfile
34+
build-args: |
35+
BUILD_TYPE=minimal
36+
USE_LOCAL_SOURCE=1
37+
tags: ccextractor:minimal
38+
load: true
39+
cache-from: type=gha,scope=docker-minimal
40+
cache-to: type=gha,mode=max,scope=docker-minimal
41+
- name: Test minimal image
42+
run: |
43+
docker run --rm ccextractor:minimal --version
44+
echo "Minimal build successful"
45+
46+
build_ocr:
47+
name: Docker build (ocr)
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v6
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
- name: Build OCR image
54+
uses: docker/build-push-action@v6
55+
with:
56+
context: .
57+
file: docker/Dockerfile
58+
build-args: |
59+
BUILD_TYPE=ocr
60+
USE_LOCAL_SOURCE=1
61+
tags: ccextractor:ocr
62+
load: true
63+
cache-from: type=gha,scope=docker-ocr
64+
cache-to: type=gha,mode=max,scope=docker-ocr
65+
- name: Test OCR image
66+
run: |
67+
docker run --rm ccextractor:ocr --version
68+
echo "OCR build successful"
69+
70+
build_hardsubx:
71+
name: Docker build (hardsubx)
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v6
75+
- name: Set up Docker Buildx
76+
uses: docker/setup-buildx-action@v3
77+
- name: Build HardSubX image
78+
uses: docker/build-push-action@v6
79+
with:
80+
context: .
81+
file: docker/Dockerfile
82+
build-args: |
83+
BUILD_TYPE=hardsubx
84+
USE_LOCAL_SOURCE=1
85+
tags: ccextractor:hardsubx
86+
load: true
87+
cache-from: type=gha,scope=docker-hardsubx
88+
cache-to: type=gha,mode=max,scope=docker-hardsubx
89+
- name: Test HardSubX image
90+
run: |
91+
docker run --rm ccextractor:hardsubx --version
92+
echo "HardSubX build successful"

0 commit comments

Comments
 (0)