Skip to content

Commit 7bb5516

Browse files
committed
feat: add latest tag
1 parent 406dd2b commit 7bb5516

File tree

1 file changed

+49
-41
lines changed

1 file changed

+49
-41
lines changed

.github/workflows/docker-image.yml

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ jobs:
1313
context: ./runtime
1414
dockerfile: ./runtime/Dockerfile.no-package
1515
tag: ghcr.io/codefuse-ai/runtime:0.1.0
16+
tag_latest: ghcr.io/codefuse-ai/runtime:latest
1617
- name: ekgfrontend
1718
context: .
1819
dockerfile: ./Dockerfile_frontend
1920
tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0
21+
tag_latest: ghcr.io/codefuse-ai/ekgfrontend:latest
2022
- name: ekgservice
2123
context: .
2224
dockerfile: ./Dockerfile_gh
2325
tag: ghcr.io/codefuse-ai/ekgservice:0.1.0
26+
tag_latest: ghcr.io/codefuse-ai/ekgservice:latest
2427

2528
steps:
2629
- name: Checkout code
@@ -39,35 +42,6 @@ jobs:
3942
username: ${{ github.actor }} # 使用当前 GitHub 用户名
4043
password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌
4144

42-
# - name: docker image
43-
# run: |
44-
# docker images
45-
# docker pull --platform linux/arm64 python:3.9-slim-bookworm
46-
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
47-
# docker rmi python:3.9-slim-bookworm
48-
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
49-
# docker images
50-
51-
# - name: docker image
52-
# run: |
53-
# docker images
54-
# docker pull --platform linux/amd64 python:3.9-slim-bookworm
55-
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
56-
# docker rmi python:3.9-slim-bookworm
57-
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
58-
# docker images
59-
# docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
60-
# docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm
61-
62-
# - name: Build and push adm64
63-
# uses: docker/build-push-action@v2
64-
# with:
65-
# context: ${{ matrix.image.context }}
66-
# file: ${{ matrix.image.dockerfile }}
67-
# push: true
68-
# tags: ${{ matrix.image.tag }}-amd64
69-
# platforms: linux/amd64
70-
7145
- name: Build and push with retry for amd64
7246
run: |
7347
max_retries=5
@@ -79,6 +53,7 @@ jobs:
7953
docker build --push \
8054
--platform linux/amd64 \
8155
--tag ${{ matrix.image.tag }}-amd64 \
56+
--tag ${{ matrix.image.tag_latest }}-amd64 \
8257
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
8358
8459
count=$(($count + 1))
@@ -95,15 +70,10 @@ jobs:
9570
run: |
9671
df -h
9772
docker images
98-
99-
# - name: Build and push amr64
100-
# uses: docker/build-push-action@v2
101-
# with:
102-
# context: ${{ matrix.image.context }}
103-
# file: ${{ matrix.image.dockerfile }}
104-
# push: true
105-
# tags: ${{ matrix.image.tag }}-arm64
106-
# platforms: linux/arm64
73+
docker rmi ${{ matrix.image.tag }}-amd64
74+
docker rmi ${{ matrix.image.tag_latest }}-amd64
75+
df -h
76+
docker images
10777
10878
- name: Build and push with retry for arm64
10979
run: |
@@ -116,6 +86,7 @@ jobs:
11686
docker build --push \
11787
--platform linux/arm64 \
11888
--tag ${{ matrix.image.tag }}-arm64 \
89+
--tag ${{ matrix.image.tag_latest }}-arm64 \
11990
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
12091
12192
count=$(($count + 1))
@@ -132,15 +103,52 @@ jobs:
132103
run: |
133104
df -h
134105
docker images
106+
docker rmi ${{ matrix.image.tag }}-arm64
107+
docker rmi ${{ matrix.image.tag_latest }}-arm64
108+
df -h
109+
docker images
135110
136111
- name: docker manifest
137112
run: |
138113
docker images
139-
docker manifest inspect ${{ matrix.image.tag }}-arm64
140-
docker manifest inspect ${{ matrix.image.tag }}-amd64
114+
141115
docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
116+
docker manifest create ${{ matrix.image.tag_latest }} ${{ matrix.image.tag_latest }}-arm64 ${{ matrix.image.tag_latest }}-amd64
117+
142118
docker manifest inspect ${{ matrix.image.tag }}
119+
docker manifest inspect ${{ matrix.image.tag_latest }}
120+
143121
docker manifest push ${{ matrix.image.tag }}
122+
docker manifest push ${{ matrix.image.tag_latest }}
144123
145124
- name: Check disk space
146-
run: df -h
125+
run: df -h
126+
127+
# - name: docker image
128+
# run: |
129+
# docker images
130+
# docker pull --platform linux/arm64 python:3.9-slim-bookworm
131+
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
132+
# docker rmi python:3.9-slim-bookworm
133+
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
134+
# docker images
135+
136+
# - name: docker image
137+
# run: |
138+
# docker images
139+
# docker pull --platform linux/amd64 python:3.9-slim-bookworm
140+
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
141+
# docker rmi python:3.9-slim-bookworm
142+
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
143+
# docker images
144+
# docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
145+
# docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm
146+
147+
# - name: Build and push adm64
148+
# uses: docker/build-push-action@v2
149+
# with:
150+
# context: ${{ matrix.image.context }}
151+
# file: ${{ matrix.image.dockerfile }}
152+
# push: true
153+
# tags: ${{ matrix.image.tag }}-amd64
154+
# platforms: linux/amd64

0 commit comments

Comments
 (0)