enable ghcr.io & disable docker.io

This commit is contained in:
ben0i0d 2024-12-10 02:21:56 +08:00
parent e659285cf5
commit 2d4308001c
4 changed files with 38 additions and 4 deletions

View File

@ -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

View File

@ -6,9 +6,9 @@ English | [中文](README_CN.md)
**THIS doc for non-CN USER**
**dockerhub: https://hub.docker.com/r/ben0i0d/jupyter**
**ghcr.io: https://github.com/eoeair/jupyter/pkgs/container/jupyter**
**Our Gitea: https://eoelab.org:1027/ben0i0d/jupyter**
**Our Gitea: https://eoelab.org:1027/eoeair/jupyter**
### HOW TO USE
**Docker**

View File

@ -6,9 +6,9 @@ English | [中文](README_CN.md)
**为中国用户的文档**
**我们的docker镜像仓库是 https://hub.docker.com/r/ben0i0d/jupyter**
**ghcr.io: https://github.com/eoeair/jupyter/pkgs/container/jupyter**
**我们的Gitea镜像仓库是 https://eoelab.org:1027/ben0i0d/jupyter**
**Our Gitea: https://eoelab.org:1027/eoeair/jupyter**
### 如何使用
**Docker**

10
retag.sh Normal file
View File

@ -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