forked from ModelEngine-Group/DataMate
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (138 loc) · 6.35 KB
/
docker-image-deer-flow.yml
File metadata and controls
155 lines (138 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Deer Flow Docker Image CI
on:
push:
branches: [ "main" ]
paths:
- 'runtime/deer-flow/**'
- 'scripts/images/deer-flow-backend/**'
- 'scripts/images/deer-flow-frontend/**'
- '.github/workflows/docker-image-deer-flow.yml'
pull_request:
branches: [ "main" ]
paths:
- 'runtime/deer-flow/**'
- 'scripts/images/deer-flow-backend/**'
- 'scripts/images/deer-flow-frontend/**'
- '.github/workflows/docker-image-deer-flow.yml'
workflow_dispatch:
workflow_call:
jobs:
build-and-push-amd:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Docker Image Tag
id: set-tag
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=amd64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=amd64" >> $GITHUB_OUTPUT
else
echo "TAGS=amd64-temp" >> $GITHUB_OUTPUT
fi
- name: Build Docker Image
run: |
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
docker build -t deer-flow-backend:amd64 . -f scripts/images/deer-flow-backend/Dockerfile
docker build -t deer-flow-frontend:amd64 . -f scripts/images/deer-flow-frontend/Dockerfile
- name: Tag & Push Docker Image
if: github.event_name != 'pull_request'
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
docker tag deer-flow-backend:amd64 ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker tag deer-flow-frontend:amd64 ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
build-and-push-arm:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Docker Image Tag
id: set-tag
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=arm64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=arm64" >> $GITHUB_OUTPUT
else
echo "TAGS=arm64-temp" >> $GITHUB_OUTPUT
fi
- name: Build Docker Image
run: |
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
docker build -t deer-flow-backend:arm64 . -f scripts/images/deer-flow-backend/Dockerfile
docker build -t deer-flow-frontend:arm64 . -f scripts/images/deer-flow-frontend/Dockerfile
- name: Tag & Push Docker Image
if: github.event_name != 'pull_request'
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
docker tag deer-flow-backend:arm64 ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker tag deer-flow-frontend:arm64 ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
manifest:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs: [ build-and-push-amd, build-and-push-arm ]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Docker Image Tag
id: set-tag
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
BASE_IMAGE=ghcr.io/$LOWERCASE_REPO/datamate-${{ inputs.service_name }}
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=$TAG" >> $GITHUB_OUTPUT
echo "ARM_TAGS=arm64-$TAG" >> $GITHUB_OUTPUT
echo "AMD_TAGS=amd64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=latest" >> $GITHUB_OUTPUT
echo "ARM_TAGS=arm64" >> $GITHUB_OUTPUT
echo "AMD_TAGS=amd64" >> $GITHUB_OUTPUT
else
echo "TAGS=temp" >> $GITHUB_OUTPUT
echo "ARM_TAGS=arm64-temp" >> $GITHUB_OUTPUT
echo "AMD_TAGS=amd64-temp" >> $GITHUB_OUTPUT
fi
- name: Manifest Docker Image
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
docker manifest create ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.AMD_TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.ARM_TAGS }}
docker manifest push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker manifest create ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.AMD_TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.ARM_TAGS }}
docker manifest push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}