Skip to content

Commit f48858b

Browse files
Multi-arch build
1 parent de36643 commit f48858b

File tree

1 file changed

+11
-70
lines changed

1 file changed

+11
-70
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
echo "EOF"
6262
} >> "$GITHUB_OUTPUT"
6363
64-
build_analyzers_amd64:
65-
name: Build Analyzers (amd64)
64+
build_analyzers:
65+
name: Build Analyzers (multi-arch)
6666
needs: generate-matrix
6767
runs-on: ubuntu-latest
6868
strategy:
@@ -84,45 +84,15 @@ jobs:
8484
- name: Pre-pull builder image (if not already cached)
8585
run: docker pull thehiveproject/cortex-neurons-builder:latest
8686

87-
- name: Build analyzer ${{ matrix.directory }} for amd64
87+
- name: Build analyzer ${{ matrix.directory }} (linux/amd64,linux/arm64)
8888
uses: docker://thehiveproject/cortex-neurons-builder:latest
8989
with:
9090
driver-opts: image=moby/buildkit:v0.19.0
9191
args: |
92-
--namespace cortexneurons --path analyzers -w ${{ matrix.directory }} --registry_dockerhub ${{ secrets.REGISTRY_DOCKERHUB }} --platform linux/amd64 ${{ (startsWith(github.ref, 'refs/tags') || github.event_name == 'schedule') && '--stable' || '' }}
92+
--namespace cortexneurons --path analyzers -w ${{ matrix.directory }} --registry_dockerhub ${{ secrets.REGISTRY_DOCKERHUB }} --platform linux/amd64,linux/arm64 ${{ (startsWith(github.ref, 'refs/tags') || github.event_name == 'schedule') && '--stable' || '' }}
9393
94-
build_analyzers_arm64:
95-
name: Build Analyzers (arm64)
96-
needs: [ generate-matrix, build_analyzers_amd64 ]
97-
runs-on: ubuntu-latest
98-
strategy:
99-
fail-fast: false
100-
matrix:
101-
directory: ${{ fromJson(needs.generate-matrix.outputs.analyzers_matrix).include[*].directory }}
102-
steps:
103-
- name: Checkout repository
104-
uses: actions/checkout@v4
105-
with:
106-
fetch-depth: 0
107-
108-
- name: Set up QEMU
109-
uses: docker/setup-qemu-action@v2
110-
111-
- name: Set up Docker Buildx
112-
uses: docker/setup-buildx-action@v2
113-
114-
- name: Pre-pull builder image (if not already cached)
115-
run: docker pull thehiveproject/cortex-neurons-builder:latest
116-
117-
- name: Build analyzer ${{ matrix.directory }} for arm64
118-
uses: docker://thehiveproject/cortex-neurons-builder:latest
119-
with:
120-
driver-opts: image=moby/buildkit:v0.19.0
121-
args: |
122-
--namespace cortexneurons --path analyzers -w ${{ matrix.directory }} --registry_dockerhub ${{ secrets.REGISTRY_DOCKERHUB }} --platform linux/arm64 ${{ (startsWith(github.ref, 'refs/tags') || github.event_name == 'schedule') && '--stable' || '' }}
123-
124-
build_responders_amd64:
125-
name: Build Responders (amd64)
94+
build_responders:
95+
name: Build Responders (multi-arch)
12696
needs: generate-matrix
12797
runs-on: ubuntu-latest
12898
strategy:
@@ -144,47 +114,18 @@ jobs:
144114
- name: Pre-pull builder image (if not already cached)
145115
run: docker pull thehiveproject/cortex-neurons-builder:latest
146116

147-
- name: Build responder ${{ matrix.directory }} for amd64
117+
- name: Build responder ${{ matrix.directory }} (linux/amd64,linux/arm64)
148118
uses: docker://thehiveproject/cortex-neurons-builder:latest
149119
with:
150120
driver-opts: image=moby/buildkit:v0.19.0
151121
args: |
152-
--namespace cortexneurons --path responders -w ${{ matrix.directory }} --registry_dockerhub ${{ secrets.REGISTRY_DOCKERHUB }} --platform linux/amd64 ${{ (startsWith(github.ref, 'refs/tags') || github.event_name == 'schedule') && '--stable' || '' }}
122+
--namespace cortexneurons --path responders -w ${{ matrix.directory }} --registry_dockerhub ${{ secrets.REGISTRY_DOCKERHUB }} --platform linux/amd64,linux/arm64 ${{ (startsWith(github.ref, 'refs/tags') || github.event_name == 'schedule') && '--stable' || '' }}
153123
154-
build_responders_arm64:
155-
name: Build Responders (arm64)
156-
needs: [ generate-matrix, build_responders_amd64 ]
157-
runs-on: ubuntu-latest
158-
strategy:
159-
fail-fast: false
160-
matrix:
161-
directory: ${{ fromJson(needs.generate-matrix.outputs.responders_matrix).include[*].directory }}
162-
steps:
163-
- name: Checkout repository
164-
uses: actions/checkout@v4
165-
with:
166-
fetch-depth: 0
167-
168-
- name: Set up QEMU
169-
uses: docker/setup-qemu-action@v2
170-
171-
- name: Set up Docker Buildx
172-
uses: docker/setup-buildx-action@v2
173-
174-
- name: Pre-pull builder image (if not already cached)
175-
run: docker pull thehiveproject/cortex-neurons-builder:latest
176-
177-
- name: Build responder ${{ matrix.directory }} for arm64
178-
uses: docker://thehiveproject/cortex-neurons-builder:latest
179-
with:
180-
driver-opts: image=moby/buildkit:v0.19.0
181-
args: |
182-
--namespace cortexneurons --path responders -w ${{ matrix.directory }} --registry_dockerhub ${{ secrets.REGISTRY_DOCKERHUB }} --platform linux/arm64 ${{ (startsWith(github.ref, 'refs/tags') || github.event_name == 'schedule') && '--stable' || '' }}
183124
184125
build_catalog:
185126
name: Build Catalog
186127
runs-on: ubuntu-latest
187-
needs: [ build_analyzers_amd64, build_analyzers_arm64, build_responders_amd64, build_responders_arm64 ]
128+
needs: [ build_analyzers, build_responders ]
188129
if: always()
189130
steps:
190131
- name: Checkout repository
@@ -216,7 +157,7 @@ jobs:
216157
build_docs:
217158
name: Build documentation
218159
runs-on: ubuntu-latest
219-
needs: [ build_analyzers_amd64, build_analyzers_arm64, build_responders_amd64, build_responders_arm64 ]
160+
needs: [ build_analyzers, build_responders ]
220161
if: startsWith(github.ref, 'refs/tags/') && always()
221162
steps:
222163
- uses: actions/checkout@v4
@@ -241,7 +182,7 @@ jobs:
241182
notify:
242183
name: Notify
243184
runs-on: ubuntu-latest
244-
needs: [ build_analyzers_amd64, build_analyzers_arm64, build_responders_amd64, build_responders_arm64, build_catalog, build_docs ]
185+
needs: [ build_analyzers, build_responders, build_catalog, build_docs ]
245186
if: false # Temporarily disable notifications
246187
steps:
247188
- name: Slack notification

0 commit comments

Comments
 (0)