Skip to content

Commit

Permalink
add cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
ppaanngggg committed Jul 2, 2024
1 parent d61d064 commit 6f6fe10
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.png filter=lfs diff=lfs merge=lfs -text
yolo-doclaynet.pt filter=lfs diff=lfs merge=lfs -text
34 changes: 34 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ppaanngggg/yolo-doclaynet

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ultralytics/ultralytics:8.2.16-cpu
FROM ultralytics/ultralytics:8.2.48-cpu

WORKDIR /app

RUN pip install fastapi uvicorn pydantic_settings loguru -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install fastapi uvicorn pydantic_settings loguru
ADD yolo-doclaynet.pt /app/yolo-doclaynet.pt
ADD main.py /app/main.py
ADD yolov8n-doclaynet.pt /app/yolov8n-doclaynet.pt

CMD ["python", "main.py"]
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class Conf(BaseSettings):
model_path: str = Field(default="yolov8n-doclaynet.pt", description="Model path")
model_path: str = Field(default="yolo-doclaynet.pt", description="Model path")
max_connections: int = Field(
default=10, description="Maximum number of connections"
)
Expand Down
3 changes: 3 additions & 0 deletions yolo-doclaynet.pt
Git LFS file not shown

0 comments on commit 6f6fe10

Please sign in to comment.