Skip to content
Closed
Changes from 1 commit
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
43 changes: 18 additions & 25 deletions .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,21 @@ on:
default: '[]'

jobs:
build-main:
build-images:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
strategy:
matrix:
target: [main, data-process, web]
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
- name: Check if model is cached locally
if: matrix.target == 'data-process'
id: check-model
run: |
if [ -f ~/model-assets/clip-vit-base-patch32/config.json ] && [ -d ~/model-assets/nltk_data ]; then
Expand All @@ -45,30 +40,28 @@ jobs:
else
echo "cache-hit=false" >> "$GITHUB_OUTPUT"
fi

- name: Clone model if not cached
if: steps.check-model.outputs.cache-hit == 'false'
if: matrix.target == 'data-process' && steps.check-model.outputs.cache-hit == 'false'
Copy link

Copilot AI Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition references steps.check-model.outputs.cache-hit but the check-model step only runs when matrix.target == 'data-process'. For other matrix targets, this step doesn't exist and the condition will fail. Consider restructuring the conditions or using a default value.

Suggested change
if: matrix.target == 'data-process' && steps.check-model.outputs.cache-hit == 'false'
if: ${{ matrix.target == 'data-process' && steps.check-model.outputs.cache-hit == 'false' }}

Copilot uses AI. Check for mistakes.
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 docker image
run: |
if [ "${{ matrix.target }}" = "main" ]; then
docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent -f make/main/Dockerfile .
elif [ "${{ matrix.target }}" = "data-process" ]; then
docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent-data-process -f make/data_process/Dockerfile .
else
docker build --build-arg MIRROR=https://registry.npmmirror.com -t nexent/nexent-web -f make/web/Dockerfile .
Copy link

Copilot AI Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The else clause assumes any target other than 'main' or 'data-process' is 'web'. This could lead to unexpected behavior if the matrix is extended with additional targets. Consider explicitly checking for 'web' target: elif [ "${{ matrix.target }}" = "web" ]; then

Suggested change
else
docker build --build-arg MIRROR=https://registry.npmmirror.com -t nexent/nexent-web -f make/web/Dockerfile .
elif [ "${{ matrix.target }}" = "web" ]; then
docker build --build-arg MIRROR=https://registry.npmmirror.com -t nexent/nexent-web -f make/web/Dockerfile .
else
echo "Unknown target: ${{ matrix.target }}" >&2
exit 1

Copilot uses AI. Check for mistakes.
fi

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