refactor: ci/cd
Browse files- .github/workflows/docker.yml +9 -2
- docker-compose.yml +1 -1
- pyproject.toml +1 -1
.github/workflows/docker.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
name: Docker
|
2 |
|
3 |
on:
|
4 |
push:
|
@@ -20,6 +20,10 @@ on:
|
|
20 |
|
21 |
jobs:
|
22 |
docker:
|
|
|
|
|
|
|
|
|
23 |
runs-on: ubuntu-latest
|
24 |
steps:
|
25 |
- name: Checkout
|
@@ -28,7 +32,9 @@ jobs:
|
|
28 |
- name: Set up Docker Buildx
|
29 |
uses: docker/setup-buildx-action@v3
|
30 |
|
|
|
31 |
- name: Login to Docker Hub
|
|
|
32 |
uses: docker/login-action@v3
|
33 |
with:
|
34 |
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
@@ -38,7 +44,8 @@ jobs:
|
|
38 |
uses: docker/build-push-action@v5
|
39 |
with:
|
40 |
context: .
|
41 |
-
push
|
|
|
42 |
tags: jeff52415/llmdataparser:latest
|
43 |
cache-from: type=registry,ref=jeff52415/llmdataparser:latest
|
44 |
cache-to: type=inline
|
|
|
1 |
+
name: Docker CD
|
2 |
|
3 |
on:
|
4 |
push:
|
|
|
20 |
|
21 |
jobs:
|
22 |
docker:
|
23 |
+
# Only run this job if:
|
24 |
+
# 1. It's a push to main (merge), OR
|
25 |
+
# 2. It's a pull request
|
26 |
+
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
27 |
runs-on: ubuntu-latest
|
28 |
steps:
|
29 |
- name: Checkout
|
|
|
32 |
- name: Set up Docker Buildx
|
33 |
uses: docker/setup-buildx-action@v3
|
34 |
|
35 |
+
# Only run Docker login and push when merging to main
|
36 |
- name: Login to Docker Hub
|
37 |
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
38 |
uses: docker/login-action@v3
|
39 |
with:
|
40 |
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
44 |
uses: docker/build-push-action@v5
|
45 |
with:
|
46 |
context: .
|
47 |
+
# Only push when merging to main
|
48 |
+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
49 |
tags: jeff52415/llmdataparser:latest
|
50 |
cache-from: type=registry,ref=jeff52415/llmdataparser:latest
|
51 |
cache-to: type=inline
|
docker-compose.yml
CHANGED
@@ -2,7 +2,7 @@ version: "3.8"
|
|
2 |
|
3 |
services:
|
4 |
llmdataparser:
|
5 |
-
build:
|
6 |
environment:
|
7 |
- GRADIO_SERVER_PORT=7860
|
8 |
volumes:
|
|
|
2 |
|
3 |
services:
|
4 |
llmdataparser:
|
5 |
+
build: jeff52415/llmdataparser
|
6 |
environment:
|
7 |
- GRADIO_SERVER_PORT=7860
|
8 |
volumes:
|
pyproject.toml
CHANGED
@@ -28,7 +28,7 @@ packages = [
|
|
28 |
start = "llmdataparser.app:main"
|
29 |
|
30 |
[tool.poetry.dependencies]
|
31 |
-
python = ">=3.
|
32 |
pandas = "^2.0.3"
|
33 |
datasets = "^3.2.0"
|
34 |
fsspec = "^2024.9.0"
|
|
|
28 |
start = "llmdataparser.app:main"
|
29 |
|
30 |
[tool.poetry.dependencies]
|
31 |
+
python = ">=3.10"
|
32 |
pandas = "^2.0.3"
|
33 |
datasets = "^3.2.0"
|
34 |
fsspec = "^2024.9.0"
|