66jobs :
77 build :
88 runs-on : ubuntu-20.04 # 或者指定其他版本
9- # strategy:
10- # matrix:
11- # image:
12- # - name: runtime
13- # context: ./runtime
14- # dockerfile: ./runtime/Dockerfile.no-package
15- # tag: ghcr.io/codefuse-ai/runtime:0.1.0
16- # - name: ekgfrontend
17- # context: .
18- # dockerfile: ./Dockerfile_frontend
19- # tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0
20- # - name: ekgservice
21- # context: .
22- # dockerfile: ./Dockerfile_gh
23- # tag: ghcr.io/codefuse-ai/ekgservice:0.1.0
9+ strategy :
10+ matrix :
11+ image :
12+ - name : runtime
13+ context : ./runtime
14+ dockerfile : ./runtime/Dockerfile.no-package
15+ tag : ghcr.io/codefuse-ai/runtime:0.1.0
16+ - name : ekgfrontend
17+ context : .
18+ dockerfile : ./Dockerfile_frontend
19+ tag : ghcr.io/codefuse-ai/ekgfrontend:0.1.0
20+ - name : ekgservice
21+ context : .
22+ dockerfile : ./Dockerfile_gh
23+ tag : ghcr.io/codefuse-ai/ekgservice:0.1.0
2424
2525 steps :
2626 - name : Checkout code
@@ -42,57 +42,62 @@ jobs:
4242 - name : Check disk space
4343 run : df -h
4444
45- - name : Clean up Docker
46- run : docker system prune -af
45+ # - name: docker image
46+ # run: |
47+ # docker images
48+ # docker pull --platform linux/arm64 python:3.9-slim-bookworm
49+ # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
50+ # docker rmi python:3.9-slim-bookworm
51+ # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
52+ # docker images
4753
48- - name : Check disk space
49- run : df -h
54+ # - name: docker image
55+ # run: |
56+ # docker images
57+ # docker pull --platform linux/amd64 python:3.9-slim-bookworm
58+ # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
59+ # docker rmi python:3.9-slim-bookworm
60+ # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
61+ # docker images
62+ # 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
63+ # docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm
64+
65+ - name : Build and push adm64
66+ uses : docker/build-push-action@v2
67+ with :
68+ context : ${{ matrix.image.context }}
69+ file : ${{ matrix.image.dockerfile }}
70+ push : true
71+ tags : ${{ matrix.image.tag }}-amd64
72+ platforms : linux/amd64
5073
5174 - name : docker image
5275 run : |
5376 docker images
54- docker pull --platform linux/arm64 python:3.9-slim-bookworm
55- docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
56- docker rmi python:3.9-slim-bookworm
57- docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
58- docker images
77+ docker rmi ${{ matrix.image.tag }}-amd64
78+ docker images
5979
80+
81+ - name : Build and push amr64
82+ uses : docker/build-push-action@v2
83+ with :
84+ context : ${{ matrix.image.context }}
85+ file : ${{ matrix.image.dockerfile }}
86+ push : true
87+ tags : ${{ matrix.image.tag }}-arm64
88+ platforms : linux/arm64
89+
6090 - name : docker image
6191 run : |
6292 docker images
63- docker pull --platform linux/amd64 python:3.9-slim-bookworm
64- docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
65- docker rmi python:3.9-slim-bookworm
66- docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
93+ docker rmi ${{ matrix.image.tag }}-arm64
6794 docker images
68- 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
69- docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm
7095
71- # - name: Build and push
72- # uses: docker/build-push-action@v2
73- # with:
74- # context: ${{ matrix.image.context }}
75- # file: ${{ matrix.image.dockerfile }}
76- # push: true
77- # tags: ${{ matrix.image.tag }}-amd64
78- # platforms: linux/amd64
79-
80- # - name: Build and push
81- # uses: docker/build-push-action@v2
82- # with:
83- # context: ${{ matrix.image.context }}
84- # file: ${{ matrix.image.dockerfile }}
85- # push: true
86- # tags: ${{ matrix.image.tag }}-arm64
87- # platforms: linux/arm64
88- # # platforms: |
89- # # linux/amd64
90- # # linux/arm64
91-
92- # - name: docker image
93- # run: |
94- # docker images
95- # docker buildx imagetools create -t ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
96+ - name : docker image
97+ run : |
98+ docker images
99+ docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
100+ docker manifest inspect ${{ matrix.image.tag }}
96101
97102 - name : Check disk space
98103 run : df -h
0 commit comments