Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,16 @@ on:
default: '[]'

jobs:
build-main:
build-images:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
retries: 3
- name: Build main application image
run: docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent -f make/main/Dockerfile .

build-data-process:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
retries: 3
# Data process specific cache handling (for data-process build)
- name: Check if model is cached locally
id: check-model
run: |
Expand All @@ -45,30 +36,35 @@ jobs:
else
echo "cache-hit=false" >> "$GITHUB_OUTPUT"
fi

- name: Clone model if not cached
if: steps.check-model.outputs.cache-hit == 'false'
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://hf-mirror.com/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image
run: docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent-data-process -f make/data_process/Dockerfile .

build-web:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
retries: 3
- name: Build web frontend image
run: docker build --build-arg MIRROR=https://registry.npmmirror.com -t nexent/nexent-web -f make/web/Dockerfile .
- name: Build all Docker images in parallel
run: |
set -e
echo "Starting parallel Docker builds..."
docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent -f make/main/Dockerfile . &
PID_MAIN=$!

docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent-data-process -f make/data_process/Dockerfile . &
PID_DATA=$!

docker build --build-arg MIRROR=https://registry.npmmirror.com -t nexent/nexent-web -f make/web/Dockerfile . &
PID_WEB=$!

# Wait for all builds to finish
wait $PID_MAIN $PID_DATA $PID_WEB
echo "All Docker images built successfully."

deploy:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
needs: [ build-main, build-data-process, build-web ]
needs: build-images
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
Loading