Skip to content

Commit 2d39c43

Browse files
committed
chore: update Docker actions to latest versions and add caching for builds
1 parent 9a2a8c8 commit 2d39c43

1 file changed

Lines changed: 21 additions & 15 deletions

File tree

‎.github/workflows/docker-build.yml‎

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v7
1616

1717
- name: Set up Docker Buildx
18-
uses: docker/setup-buildx-action@v3
18+
uses: docker/setup-buildx-action@v4
1919

2020
- name: Login to Docker Hub
21-
uses: docker/login-action@v3
21+
uses: docker/login-action@v4
2222
with:
2323
username: ${{ secrets.DOCKERHUB_USERNAME }}
2424
password: ${{ secrets.DOCKERHUB_TOKEN }}
2525

2626
- name: Extract metadata for main_api
2727
id: meta_main
28-
uses: docker/metadata-action@v5
28+
uses: docker/metadata-action@v6
2929
with:
3030
images: ${{ secrets.DOCKERHUB_USERNAME }}/main_api
3131
tags: |
@@ -34,32 +34,34 @@ jobs:
3434
type=semver,pattern={{version}}
3535
3636
- name: Build and push main_api
37-
uses: docker/build-push-action@v5
37+
uses: docker/build-push-action@v7
3838
with:
3939
context: ./main_api
4040
file: ./main_api/Dockerfile
4141
push: true
4242
tags: ${{ steps.meta_main.outputs.tags }}
4343
labels: ${{ steps.meta_main.outputs.labels }}
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max
4446

4547
build-and-push-inference-cpu:
4648
runs-on: ubuntu-latest
4749
steps:
4850
- name: Checkout code
49-
uses: actions/checkout@v4
51+
uses: actions/checkout@v7
5052

5153
- name: Set up Docker Buildx
52-
uses: docker/setup-buildx-action@v3
54+
uses: docker/setup-buildx-action@v4
5355

5456
- name: Login to Docker Hub
55-
uses: docker/login-action@v3
57+
uses: docker/login-action@v4
5658
with:
5759
username: ${{ secrets.DOCKERHUB_USERNAME }}
5860
password: ${{ secrets.DOCKERHUB_TOKEN }}
5961

6062
- name: Extract metadata for inference_api (CPU)
6163
id: meta_cpu
62-
uses: docker/metadata-action@v5
64+
uses: docker/metadata-action@v6
6365
with:
6466
images: ${{ secrets.DOCKERHUB_USERNAME }}/inference_api
6567
tags: |
@@ -68,32 +70,34 @@ jobs:
6870
type=semver,pattern=cpu-{{version}}
6971
7072
- name: Build and push inference_api (CPU)
71-
uses: docker/build-push-action@v5
73+
uses: docker/build-push-action@v7
7274
with:
7375
context: ./inference_api
7476
file: ./inference_api/Dockerfile
7577
push: true
7678
tags: ${{ steps.meta_cpu.outputs.tags }}
7779
labels: ${{ steps.meta_cpu.outputs.labels }}
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max
7882

7983
build-and-push-inference-gpu:
8084
runs-on: ubuntu-latest
8185
steps:
8286
- name: Checkout code
83-
uses: actions/checkout@v4
87+
uses: actions/checkout@v7
8488

8589
- name: Set up Docker Buildx
86-
uses: docker/setup-buildx-action@v3
90+
uses: docker/setup-buildx-action@v4
8791

8892
- name: Login to Docker Hub
89-
uses: docker/login-action@v3
93+
uses: docker/login-action@v4
9094
with:
9195
username: ${{ secrets.DOCKERHUB_USERNAME }}
9296
password: ${{ secrets.DOCKERHUB_TOKEN }}
9397

9498
- name: Extract metadata for inference_api (GPU)
9599
id: meta_gpu
96-
uses: docker/metadata-action@v5
100+
uses: docker/metadata-action@v6
97101
with:
98102
images: ${{ secrets.DOCKERHUB_USERNAME }}/inference_api
99103
tags: |
@@ -102,10 +106,12 @@ jobs:
102106
type=semver,pattern=gpu-{{version}}
103107
104108
- name: Build and push inference_api (GPU)
105-
uses: docker/build-push-action@v5
109+
uses: docker/build-push-action@v7
106110
with:
107111
context: ./inference_api
108112
file: ./inference_api/Dockerfile.gpu
109113
push: true
110114
tags: ${{ steps.meta_gpu.outputs.tags }}
111115
labels: ${{ steps.meta_gpu.outputs.labels }}
116+
cache-from: type=gha
117+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)