Skip to content

Commit 9ae0c7a

Browse files
committed
🔨 update build action
1 parent 6aa3fdd commit 9ae0c7a

File tree

2 files changed

+73
-26
lines changed

2 files changed

+73
-26
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Docker Build and Push All Images
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
runner_label_json:
7+
description: 'JSON 格式的 runner 标签数组'
8+
required: true
9+
default: '["self-hosted", "MacOS", "ARM64"]'
10+
11+
jobs:
12+
setup-builder:
13+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
14+
steps:
15+
- name: Set up Docker Buildx
16+
run: |
17+
docker buildx create --name nexent_builder --use
18+
19+
build-and-push-base:
20+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
21+
needs: setup-builder
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
- name: Build and push base image (multi-arch)
26+
run: |
27+
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-base -f make/base/Dockerfile . --push
28+
29+
build-and-push-main:
30+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
31+
needs: build-and-push-base
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
- name: Build and push main application image (multi-arch)
36+
run: |
37+
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent -f make/main/Dockerfile . --push
38+
39+
build-and-push-data-process:
40+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
41+
needs: setup-builder
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
- name: Check if model is cached locally
46+
id: check-model
47+
run: |
48+
if [ -f ./model-assets/clip-vit-base-patch32/config.json ]; then
49+
echo "cache-hit=true" >> "$GITHUB_OUTPUT"
50+
else
51+
echo "cache-hit=false" >> "$GITHUB_OUTPUT"
52+
fi
53+
- name: Clone model if not cached
54+
if: steps.check-model.outputs.cache-hit == 'false'
55+
run: |
56+
mkdir -p ./model-assets
57+
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/openai/clip-vit-base-patch32 ./model-assets/clip-vit-base-patch32
58+
cd ./model-assets/clip-vit-base-patch32
59+
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
60+
rm -rf .git flax_model.msgpack tf_model.h5
61+
- name: Build and push data process image (multi-arch)
62+
run: |
63+
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-data-process -f make/data_process/Dockerfile . --push
64+
65+
build-and-push-web:
66+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
67+
needs: setup-builder
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
- name: Build and push web frontend image (multi-arch)
72+
run: |
73+
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-web -f make/web/Dockerfile . --push

.github/workflows/test.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)