Skip to content

Commit 71d3a66

Browse files
author
jiangpeiling
committed
🔨 improve the CICD process.
1 parent 310da66 commit 71d3a66

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

‎.github/workflows/docker-build-dev.yml‎

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ on:
88
workflow_dispatch:
99
pull_request:
1010
branches: [develop]
11-
push:
12-
branches: [develop]
1311

1412
jobs:
1513
build-main-amd64:
1614
runs-on: ubuntu-latest
1715
if: |
1816
github.event_name == 'workflow_dispatch' ||
19-
contains(toJSON(github.event.head_commit), 'backend/') ||
20-
contains(toJSON(github.event.head_commit), 'sdk/') ||
21-
contains(toJSON(github.event.head_commit), 'make/main/')
17+
contains(github.event.pull_request.files.*.filename, 'backend/') ||
18+
contains(github.event.pull_request.files.*.filename, 'sdk/') ||
19+
contains(github.event.pull_request.files.*.filename, 'make/main/')
2220
steps:
2321
- name: Set up Docker Buildx
2422
run: |
@@ -29,6 +27,16 @@ jobs:
2927
fi
3028
- name: Checkout code
3129
uses: actions/checkout@v4
30+
- name: Debug - Print PR files info
31+
run: |
32+
echo "=== PR Files Debug Info ==="
33+
echo "Event name: ${{ github.event_name }}"
34+
echo "PR files count: ${{ length(github.event.pull_request.files) }}"
35+
echo "=== File paths (what contains() checks) ==="
36+
echo '${{ toJSON(github.event.pull_request.files.*.filename) }}'
37+
echo "=== Full file objects ==="
38+
echo '${{ toJSON(github.event.pull_request.files) }}'
39+
echo "=== End Debug Info ==="
3240
- name: Build main image (amd64) and load locally
3341
run: |
3442
docker buildx build --platform linux/amd64 -t nexent/nexent:dev-amd64 --load -f make/main/Dockerfile .
@@ -37,9 +45,9 @@ jobs:
3745
runs-on: ubuntu-latest
3846
if: |
3947
github.event_name == 'workflow_dispatch' ||
40-
contains(toJSON(github.event.head_commit), 'backend/') ||
41-
contains(toJSON(github.event.head_commit), 'sdk/') ||
42-
contains(toJSON(github.event.head_commit), 'make/main/')
48+
contains(github.event.pull_request.files.*.filename, 'backend/') ||
49+
contains(github.event.pull_request.files.*.filename, 'sdk/') ||
50+
contains(github.event.pull_request.files.*.filename, 'make/main/')
4351
steps:
4452
- name: Set up Docker Buildx
4553
run: |
@@ -58,9 +66,9 @@ jobs:
5866
runs-on: ubuntu-latest
5967
if: |
6068
github.event_name == 'workflow_dispatch' ||
61-
contains(toJSON(github.event.head_commit), 'backend/') ||
62-
contains(toJSON(github.event.head_commit), 'sdk/') ||
63-
contains(toJSON(github.event.head_commit), 'make/data_process/')
69+
contains(github.event.pull_request.files.*.filename, 'backend/') ||
70+
contains(github.event.pull_request.files.*.filename, 'sdk/') ||
71+
contains(github.event.pull_request.files.*.filename, 'make/data_process/')
6472
steps:
6573
- name: Free up disk space on GitHub runner
6674
run: |
@@ -88,9 +96,9 @@ jobs:
8896
runs-on: ubuntu-latest
8997
if: |
9098
github.event_name == 'workflow_dispatch' ||
91-
contains(toJSON(github.event.head_commit), 'backend/') ||
92-
contains(toJSON(github.event.head_commit), 'sdk/') ||
93-
contains(toJSON(github.event.head_commit), 'make/data_process/')
99+
contains(github.event.pull_request.files.*.filename, 'backend/') ||
100+
contains(github.event.pull_request.files.*.filename, 'sdk/') ||
101+
contains(github.event.pull_request.files.*.filename, 'make/data_process/')
94102
steps:
95103
- name: Free up disk space on GitHub runner
96104
run: |
@@ -118,8 +126,8 @@ jobs:
118126
runs-on: ubuntu-latest
119127
if: |
120128
github.event_name == 'workflow_dispatch' ||
121-
contains(toJSON(github.event.head_commit), 'frontend/') ||
122-
contains(toJSON(github.event.head_commit), 'make/web/')
129+
contains(github.event.pull_request.files.*.filename, 'frontend/') ||
130+
contains(github.event.pull_request.files.*.filename, 'make/web/')
123131
steps:
124132
- name: Set up Docker Buildx
125133
run: |
@@ -138,8 +146,8 @@ jobs:
138146
runs-on: ubuntu-latest
139147
if: |
140148
github.event_name == 'workflow_dispatch' ||
141-
contains(toJSON(github.event.head_commit), 'frontend/') ||
142-
contains(toJSON(github.event.head_commit), 'make/web/')
149+
contains(github.event.pull_request.files.*.filename, 'frontend/') ||
150+
contains(github.event.pull_request.files.*.filename, 'make/web/')
143151
steps:
144152
- name: Set up Docker Buildx
145153
run: |
@@ -152,13 +160,13 @@ jobs:
152160
uses: actions/checkout@v4
153161
- name: Build web image (arm64) and load locally
154162
run: |
155-
docker buildx build --platform linux/arm64 -t nexent/nexent-web:dev-arm64 --load -f make/web/Dockerfile .
163+
docker buildx build --platform linux/amd64 -t nexent/nexent-web:dev-amd64 --load -f make/web/Dockerfile .
156164
157165
build-terminal-amd64:
158166
runs-on: ubuntu-latest
159167
if: |
160168
github.event_name == 'workflow_dispatch' ||
161-
contains(toJSON(github.event.head_commit), 'make/terminal/')
169+
contains(github.event.pull_request.files.*.filename, 'make/terminal/')
162170
steps:
163171
- name: Set up Docker Buildx
164172
run: |
@@ -177,7 +185,7 @@ jobs:
177185
runs-on: ubuntu-latest
178186
if: |
179187
github.event_name == 'workflow_dispatch' ||
180-
contains(toJSON(github.event.head_commit), 'make/terminal/')
188+
contains(github.event.pull_request.files.*.filename, 'make/terminal/')
181189
steps:
182190
- name: Set up Docker Buildx
183191
run: |

‎frontend/public/locales/en/common.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
23
"assistant.name": "Nexent",
34

45
"chatAttachment.imagePreview": "Image Preview",

‎make/main/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
FROM python:3.10-slim
23
ARG MIRROR
34
ARG APT_MIRROR

0 commit comments

Comments
 (0)