From a4aff3ed8ad603337a292ade04bc06e60363190b Mon Sep 17 00:00:00 2001 From: ben0i0d Date: Tue, 10 Dec 2024 02:11:10 +0800 Subject: [PATCH] enable pushto ghcr(dockerhub is disable) --- .gitea/workflows/Push_ghcr.yaml | 24 ++++++++++++++++++++++++ README.md | 5 +++-- README_CN.md | 4 ++-- retag.sh | 10 ++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 .gitea/workflows/Push_ghcr.yaml create mode 100644 retag.sh diff --git a/.gitea/workflows/Push_ghcr.yaml b/.gitea/workflows/Push_ghcr.yaml new file mode 100644 index 0000000..d9a7a7a --- /dev/null +++ b/.gitea/workflows/Push_ghcr.yaml @@ -0,0 +1,24 @@ +name: Push_ghcr + +on: + push: + # Sequence of patterns matched against refs/heads + branches: + - main + +jobs: + Push: + runs-on: runner + steps: + - name: checkout code + uses: https://eoelab.org:1027/actions/checkout@v4 + - name: retag images + run: bash retag.sh + - name: login ghcr_registry + uses: https://eoelab.org:1027/actions/login-action@v3 + with: + registry: ghcr.io + username: ${{ secrets.USERNAME }} + password: ${{ secrets.GHCR_PASSWD }} + - name: push images to ghcr_registry + run: docker image push "ghcr.io/${{ gitea.repository }}" --all-tags \ No newline at end of file diff --git a/README.md b/README.md index a01b86b..40e330e 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ English | [中文](README_CN.md) **THIS doc for non-CN USER** -**dockerhub: https://hub.docker.com/r/ben0i0d/cenv** +**ghcr.io: https://github.com/eoeair/cenv/pkgs/container/cenv** -**Our Gitea: https://eoelab.org:1027/ben0i0d/cenv** +**Our Gitea: https://eoelab.org:1027/eoeair/cenv** ## Prerequisites * CPU : nothing to do @@ -40,6 +40,7 @@ ROCM-->B B-->C{CI} C-->CA(Hexo) +C-->CB(Jupyterlite) B-->G{GS}-->GA{MC}-->GAA(JAVA) GAA-->GAAA(JRE_8) diff --git a/README_CN.md b/README_CN.md index 9ba6026..24a4fd9 100644 --- a/README_CN.md +++ b/README_CN.md @@ -3,9 +3,9 @@ English | [中文](README_CN.md) **为中国用户的文档** -**dockerhub: https://hub.docker.com/r/ben0i0d/gpu** +**ghcr.io: https://github.com/eoeair/cenv/pkgs/container/cenv** -**Gitea: https://eoelab.org:1027/ben0i0d/gpu** +**Our Gitea: https://eoelab.org:1027/eoeair/cenv** ## 先决条件 * CPU : nothing to do diff --git a/retag.sh b/retag.sh new file mode 100644 index 0000000..e4963f6 --- /dev/null +++ b/retag.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# 定义旧镜像名称的前缀和新的命名规则 +OLD_PREFIX="eoelab.org:1027/eoeair" +NEW_PREFIX="ghcr.io/eoeair" +# 获取所有与旧前缀匹配的镜像,并进行重命名 +docker images --format "{{.Repository}}:{{.Tag}}" | grep "$OLD_PREFIX" | while read OLD_IMAGE; do + NEW_IMAGE=${OLD_IMAGE/$OLD_PREFIX/$NEW_PREFIX} + echo "Renaming $OLD_IMAGE to $NEW_IMAGE" + docker tag "$OLD_IMAGE" "$NEW_IMAGE" +done \ No newline at end of file