Skip to content

Commit 80043bd

Browse files
authored
Merge pull request #990 from Nordix/add_docker_presubmit
Add docker build validate action
2 parents b88268e + de73ac1 commit 80043bd

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Docker Build Validation
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
nephio-operator:
8+
if: contains(github.event.pull_request.changed_files, 'operators/nephio-controller-manager/') || contains(github.event.pull_request.changed_files, 'controllers/pkg')
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- run: docker build -f operators/nephio-controller-manager/Dockerfile .
13+
14+
o2ims-operator:
15+
if: contains(github.event.pull_request.changed_files, 'operators/o2ims-operator/')
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: docker build -f operators/o2ims-operator/Dockerfile operators/o2ims-operator
20+
21+
focom-operator:
22+
if: contains(github.event.pull_request.changed_files, 'operators/focom-operator/')
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- uses: actions/checkout@v4
26+
- run: docker build -f operators/focom-operator/Dockerfile operators/focom-operator
27+
28+
krm-functions:
29+
if: contains(github.event.pull_request.changed_files, 'krm-functions/')
30+
runs-on: ubuntu-22.04
31+
steps:
32+
- uses: actions/checkout@v4
33+
- run: |
34+
find krm-functions -name Dockerfile -exec dirname {} \; | while read dir; do
35+
docker build -f "$dir/Dockerfile" "$dir"
36+
done
37+
38+
gitops-tools:
39+
if: contains(github.event.pull_request.changed_files, 'gitops-tools/')
40+
runs-on: ubuntu-22.04
41+
steps:
42+
- uses: actions/checkout@v4
43+
- run: |
44+
find gitops-tools -name Dockerfile -exec dirname {} \; | while read dir; do
45+
docker build -f "$dir/Dockerfile" "$dir"
46+
done

0 commit comments

Comments
 (0)