Skip to content

Commit 5a6b007

Browse files
committed
feature: 增加归档包流水线
1 parent 54896ab commit 5a6b007

8 files changed

Lines changed: 76 additions & 1 deletion

.github/workflows/docker-image-backend-python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- 'scripts/images/datamate-python/**'
1515
- '.github/workflows/docker-image-backend-python.yml'
1616
workflow_dispatch:
17+
workflow_call:
1718

1819
jobs:
1920
call-docker-build:

.github/workflows/docker-image-backend.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- 'scripts/images/backend/**'
1515
- '.github/workflows/docker-image-backend.yml'
1616
workflow_dispatch:
17+
workflow_call:
1718

1819
jobs:
1920
call-docker-build:

.github/workflows/docker-image-database.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- 'scripts/images/database/**'
1515
- '.github/workflows/docker-image-database.yml'
1616
workflow_dispatch:
17+
workflow_call:
1718

1819
jobs:
1920
call-docker-build:

.github/workflows/docker-image-deer-flow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- 'scripts/images/deer-flow-frontend/**'
1717
- '.github/workflows/docker-image-deer-flow.yml'
1818
workflow_dispatch:
19+
workflow_call:
1920

2021
jobs:
2122
build-and-push:

.github/workflows/docker-image-frontend.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- 'scripts/images/frontend/**'
1515
- '.github/workflows/docker-image-frontend.yml'
1616
workflow_dispatch:
17+
workflow_call:
1718

1819
jobs:
1920
call-docker-build:

.github/workflows/docker-image-runtime.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- 'scripts/images/runtime/**'
1717
- '.github/workflows/docker-image-runtime.yml'
1818
workflow_dispatch:
19+
workflow_call:
1920

2021
jobs:
2122
call-docker-build:

.github/workflows/docker-images-reusable.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,18 @@ jobs:
5151
docker tag datamate-${{ inputs.service_name }}:latest ${{ steps.set-tag.outputs.TAGS }}
5252
5353
- name: Push Docker Image
54-
if: github.event_name != 'pull_request'
54+
if: github.event_name != 'pull_request' && !startsWith(github.workflow, 'Package')
5555
run: |
5656
docker push ${{ steps.set-tag.outputs.TAGS }}
5757
58+
- name: Save Docker Image
59+
if: startsWith(github.workflow, 'Package')
60+
run: |
61+
docker save -o datamate-${{ inputs.service_name }}.tar ${{ steps.set-tag.outputs.TAGS }}
62+
63+
- name: Upload Docker Image
64+
if: startsWith(github.workflow, 'Package')
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: datamate-${{ inputs.service_name }}
68+
path: datamate-${{ inputs.service_name }}.tar

.github/workflows/package.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Package All
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
backend-docker-build:
8+
name: Build and Push Backend Docker Image
9+
uses: ./.github/workflows/docker-image-backend.yml
10+
11+
frontend-docker-build:
12+
name: Build and Push Frontend Docker Image
13+
uses: ./.github/workflows/docker-image-frontend.yml
14+
15+
database-docker-build:
16+
name: Build and Push Database Docker Image
17+
uses: ./.github/workflows/docker-image-database.yml
18+
19+
runtime-docker-build:
20+
name: Build and Push Runtime Docker Image
21+
uses: ./.github/workflows/docker-image-runtime.yml
22+
23+
backend-python-docker-build:
24+
name: Build and Push Backend Python Docker Image
25+
uses: ./.github/workflows/docker-image-backend-python.yml
26+
27+
package-all:
28+
needs:
29+
- backend-docker-build
30+
- frontend-docker-build
31+
- database-docker-build
32+
- backend-python-docker-build
33+
- runtime-docker-build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Save Image
40+
uses: actions/download-artifact@v5
41+
with:
42+
path: images
43+
pattern: datamate-*
44+
merge-multiple: true
45+
46+
- name: Package
47+
run: |
48+
cp runtime/deer-flow/.env.example deployment/docker/deer-flow/.env
49+
cp runtime/deer-flow/conf.yaml.example deployment/docker/deer-flow/conf.yaml
50+
cp runtime/deer-flow/.env.example deployment/helm/deer-flow/charts/public/.env
51+
cp runtime/deer-flow/conf.yaml.example deployment/helm/deer-flow/charts/public/conf.yaml
52+
tar -cvf datamate.tar deployment/ images
53+
54+
- name: Upload Package
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: package
58+
path: datamate.tar

0 commit comments

Comments
 (0)