Paddle ocr gpu support. #4
80
.gitea/workflows/ci.yaml
Normal file
80
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
name: build_docker
|
||||||
|
run-name: ${{ gitea.event.head_commit.message }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
essential:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
Version: 1.0.${{ gitea.run_number }}
|
||||||
|
repo: seryus.ddns.net
|
||||||
|
image_cpu: seryus.ddns.net/unir/paddle-ocr-cpu
|
||||||
|
image_gpu: seryus.ddns.net/unir/paddle-ocr-gpu
|
||||||
|
steps:
|
||||||
|
- name: Output version info
|
||||||
|
run: |
|
||||||
|
echo "## Build Info" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Version: 1.0.${{ gitea.run_number }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Event: ${{ gitea.event_name }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
build_cpu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: essential
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.UNIR_REGISTRY_TOKEN }} | docker login \
|
||||||
|
-u username \
|
||||||
|
--password-stdin ${{ needs.essential.outputs.repo }}
|
||||||
|
|
||||||
|
- name: Build CPU image
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
-f src/paddle_ocr/Dockerfile.cpu \
|
||||||
|
-t ${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }} \
|
||||||
|
-t ${{ needs.essential.outputs.image_cpu }}:latest \
|
||||||
|
src/paddle_ocr/
|
||||||
|
|
||||||
|
- name: Push CPU image
|
||||||
|
if: gitea.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
docker push ${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }}
|
||||||
|
docker push ${{ needs.essential.outputs.image_cpu }}:latest
|
||||||
|
|
||||||
|
build_gpu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: essential
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.UNIR_REGISTRY_TOKEN }} | docker login \
|
||||||
|
-u username \
|
||||||
|
--password-stdin ${{ needs.essential.outputs.repo }}
|
||||||
|
|
||||||
|
- name: Build GPU image
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
-f src/paddle_ocr/Dockerfile.gpu \
|
||||||
|
-t ${{ needs.essential.outputs.image_gpu }}:${{ needs.essential.outputs.Version }} \
|
||||||
|
-t ${{ needs.essential.outputs.image_gpu }}:latest \
|
||||||
|
src/paddle_ocr/
|
||||||
|
|
||||||
|
- name: Push GPU image
|
||||||
|
if: gitea.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
docker push ${{ needs.essential.outputs.image_gpu }}:${{ needs.essential.outputs.Version }}
|
||||||
|
docker push ${{ needs.essential.outputs.image_gpu }}:latest
|
||||||
Reference in New Issue
Block a user