You've already forked DataMate
refactor: update Docker workflows to use reusable configuration and restrict branch triggers to 'main' (#15)
* refactor: update Docker workflows to use reusable configuration and restrict branch triggers to 'main'
This commit is contained in:
22
.github/workflows/docker-image-backend.yml
vendored
22
.github/workflows/docker-image-backend.yml
vendored
@@ -2,13 +2,13 @@ name: Backend Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "develop_930" ]
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'backend/**'
|
||||
- 'scripts/images/backend/**'
|
||||
- '.github/workflows/docker-image-backend.yml'
|
||||
pull_request:
|
||||
branches: [ "develop_930" ]
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'backend/**'
|
||||
- 'scripts/images/backend/**'
|
||||
@@ -16,12 +16,12 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build the Backend Docker image
|
||||
run: make build-backend
|
||||
call-docker-build:
|
||||
name: Build and Push Backend Docker Image
|
||||
uses: ./.github/workflows/docker-images-reusable.yml
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
with:
|
||||
service_name: backend
|
||||
build_dir: .
|
||||
|
||||
22
.github/workflows/docker-image-frontend.yml
vendored
22
.github/workflows/docker-image-frontend.yml
vendored
@@ -2,13 +2,13 @@ name: Frontend Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "develop_930" ]
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'frontend/**'
|
||||
- 'scripts/images/frontend/**'
|
||||
- '.github/workflows/docker-image-frontend.yml'
|
||||
pull_request:
|
||||
branches: [ "develop_930" ]
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'frontend/**'
|
||||
- 'scripts/images/frontend/**'
|
||||
@@ -16,12 +16,12 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build the Frontend Docker image
|
||||
run: make build-frontend
|
||||
call-docker-build:
|
||||
name: Build and Push Frontend Docker Image
|
||||
uses: ./.github/workflows/docker-images-reusable.yml
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
with:
|
||||
service_name: frontend
|
||||
build_dir: .
|
||||
|
||||
27
.github/workflows/docker-image-runtime.yml
vendored
Normal file
27
.github/workflows/docker-image-runtime.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Runtime Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'runtime/**'
|
||||
- 'scripts/images/runtime/**'
|
||||
- '.github/workflows/docker-image-runtime.yml'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'runtime/**'
|
||||
- 'scripts/images/runtime/**'
|
||||
- '.github/workflows/docker-image-runtime.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call-docker-build:
|
||||
name: Build and Push Runtime Docker Image
|
||||
uses: ./.github/workflows/docker-images-reusable.yml
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
with:
|
||||
service_name: runtime
|
||||
build_dir: .
|
||||
57
.github/workflows/docker-images-reusable.yml
vendored
Normal file
57
.github/workflows/docker-images-reusable.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Docker Image Build & Push
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
service_name:
|
||||
required: true
|
||||
type: string
|
||||
build_dir:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
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: |
|
||||
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=$BASE_IMAGE:$TAG" >> $GITHUB_OUTPUT
|
||||
elif [[ $GITHUB_REF == refs/heads/main ]]; then
|
||||
echo "TAGS=$BASE_IMAGE:latest" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "TAGS=$BASE_IMAGE:temp" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
make build-${{ inputs.service_name }} VERSION=latest
|
||||
|
||||
- name: Tag Docker Image
|
||||
run: |
|
||||
docker tag datamate-${{ inputs.service_name }}:latest ${{ steps.set-tag.outputs.TAGS }}
|
||||
|
||||
- name: Push Docker Image
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker push ${{ steps.set-tag.outputs.TAGS }}
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||

|
||||

|
||||
|
||||
**DataMate是面向模型微调与RAG检索的企业级数据处理平台,支持数据归集、数据管理、算子市场、数据清洗、数据合成、数据标注、数据评估、知识生成等核心功能。
|
||||
**
|
||||
**DataMate是面向模型微调与RAG检索的企业级数据处理平台,支持数据归集、数据管理、算子市场、数据清洗、数据合成、数据标注、数据评估、知识生成等核心功能。**
|
||||
|
||||
[简体中文](./README-zh.md) | [English](./README.md)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user