Skip to content

Commit 18414f1

Browse files
committed
feature: 增加deer-flow流水线
1 parent 4d21293 commit 18414f1

1 file changed

Lines changed: 41 additions & 6 deletions

File tree

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

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,47 @@ on:
1818
workflow_dispatch:
1919

2020
jobs:
21-
call-docker-build:
22-
name: Build and Push Backend Docker Image
23-
uses: ./.github/workflows/docker-images-reusable.yml
21+
build-and-push:
22+
runs-on: ubuntu-latest
2423
permissions:
2524
contents: read
2625
packages: write
27-
with:
28-
service_name: deer-flow
29-
build_dir: .
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Login to GitHub Container Registry
31+
if: github.event_name != 'pull_request'
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Set Docker Image Tag
39+
id: set-tag
40+
run: |
41+
if [[ $GITHUB_REF == refs/tags/v* ]]; then
42+
TAG=${GITHUB_REF#refs/tags/v}
43+
echo "TAGS=$TAG" >> $GITHUB_OUTPUT
44+
elif [[ $GITHUB_REF == refs/heads/main ]]; then
45+
echo "TAGS=latest" >> $GITHUB_OUTPUT
46+
else
47+
echo "TAGS=temp" >> $GITHUB_OUTPUT
48+
fi
49+
50+
- name: Build Docker Image
51+
run: |
52+
make build-deer-flow VERSION=latest
53+
54+
- name: Tag Docker Image
55+
run: |
56+
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
57+
docker tag deer-flow-backend:latest ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
58+
docker tag deer-flow-frontend:latest ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
59+
60+
- name: Push Docker Image
61+
if: github.event_name != 'pull_request'
62+
run: |
63+
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
64+
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}

0 commit comments

Comments
 (0)