Skip to content

Commit

Permalink
feat: add latest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
lightislost committed Nov 12, 2024
1 parent 406dd2b commit 7bb5516
Showing 1 changed file with 49 additions and 41 deletions.
90 changes: 49 additions & 41 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ jobs:
context: ./runtime
dockerfile: ./runtime/Dockerfile.no-package
tag: ghcr.io/codefuse-ai/runtime:0.1.0
tag_latest: ghcr.io/codefuse-ai/runtime:latest
- name: ekgfrontend
context: .
dockerfile: ./Dockerfile_frontend
tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0
tag_latest: ghcr.io/codefuse-ai/ekgfrontend:latest
- name: ekgservice
context: .
dockerfile: ./Dockerfile_gh
tag: ghcr.io/codefuse-ai/ekgservice:0.1.0
tag_latest: ghcr.io/codefuse-ai/ekgservice:latest

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

# - name: docker image
# run: |
# docker images
# docker pull --platform linux/arm64 python:3.9-slim-bookworm
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
# docker rmi python:3.9-slim-bookworm
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
# docker images

# - name: docker image
# run: |
# docker images
# docker pull --platform linux/amd64 python:3.9-slim-bookworm
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
# docker rmi python:3.9-slim-bookworm
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
# docker images
# 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
# docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm

# - name: Build and push adm64
# uses: docker/build-push-action@v2
# with:
# context: ${{ matrix.image.context }}
# file: ${{ matrix.image.dockerfile }}
# push: true
# tags: ${{ matrix.image.tag }}-amd64
# platforms: linux/amd64

- name: Build and push with retry for amd64
run: |
max_retries=5
Expand All @@ -79,6 +53,7 @@ jobs:
docker build --push \
--platform linux/amd64 \
--tag ${{ matrix.image.tag }}-amd64 \
--tag ${{ matrix.image.tag_latest }}-amd64 \
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
count=$(($count + 1))
Expand All @@ -95,15 +70,10 @@ jobs:
run: |
df -h
docker images
# - name: Build and push amr64
# uses: docker/build-push-action@v2
# with:
# context: ${{ matrix.image.context }}
# file: ${{ matrix.image.dockerfile }}
# push: true
# tags: ${{ matrix.image.tag }}-arm64
# platforms: linux/arm64
docker rmi ${{ matrix.image.tag }}-amd64
docker rmi ${{ matrix.image.tag_latest }}-amd64
df -h
docker images
- name: Build and push with retry for arm64
run: |
Expand All @@ -116,6 +86,7 @@ jobs:
docker build --push \
--platform linux/arm64 \
--tag ${{ matrix.image.tag }}-arm64 \
--tag ${{ matrix.image.tag_latest }}-arm64 \
-f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break
count=$(($count + 1))
Expand All @@ -132,15 +103,52 @@ jobs:
run: |
df -h
docker images
docker rmi ${{ matrix.image.tag }}-arm64
docker rmi ${{ matrix.image.tag_latest }}-arm64
df -h
docker images
- name: docker manifest
run: |
docker images
docker manifest inspect ${{ matrix.image.tag }}-arm64
docker manifest inspect ${{ matrix.image.tag }}-amd64
docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
docker manifest create ${{ matrix.image.tag_latest }} ${{ matrix.image.tag_latest }}-arm64 ${{ matrix.image.tag_latest }}-amd64
docker manifest inspect ${{ matrix.image.tag }}
docker manifest inspect ${{ matrix.image.tag_latest }}
docker manifest push ${{ matrix.image.tag }}
docker manifest push ${{ matrix.image.tag_latest }}
- name: Check disk space
run: df -h
run: df -h

# - name: docker image
# run: |
# docker images
# docker pull --platform linux/arm64 python:3.9-slim-bookworm
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
# docker rmi python:3.9-slim-bookworm
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
# docker images

# - name: docker image
# run: |
# docker images
# docker pull --platform linux/amd64 python:3.9-slim-bookworm
# docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
# docker rmi python:3.9-slim-bookworm
# docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
# docker images
# 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
# docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm

# - name: Build and push adm64
# uses: docker/build-push-action@v2
# with:
# context: ${{ matrix.image.context }}
# file: ${{ matrix.image.dockerfile }}
# push: true
# tags: ${{ matrix.image.tag }}-amd64
# platforms: linux/amd64

0 comments on commit 7bb5516

Please sign in to comment.