更新 .github/workflows/docker.yml
This commit is contained in:
@@ -8,7 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker:
|
build-docker:
|
||||||
name: Build and push to Gitea Registry
|
name: Build and push to Gitea Registry (Internal)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: write # 必须:允许写入软件包
|
packages: write # 必须:允许写入软件包
|
||||||
@@ -24,12 +24,11 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to Gitea Registry
|
- name: Log in to Gitea Registry (Internal)
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
# 修改点1: 这里填你的 Gitea 域名
|
# ✅ 修改点1: 使用内网地址,避开 Cloudflare 和 WAF
|
||||||
registry: git.chgr.cc
|
registry: gitea:3000
|
||||||
# 修改点2: 使用触发 Action 的 Gitea 用户名
|
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GGITEA_PAT }}
|
password: ${{ secrets.GGITEA_PAT }}
|
||||||
|
|
||||||
@@ -37,9 +36,9 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
# 修改点4: 这里的格式是 "域名/用户名/仓库名"
|
# ✅ 修改点2: 镜像名必须以 gitea:3000 开头,才能推送到内网注册中心
|
||||||
# 注意:Gitea 镜像名通常要求全小写
|
# Gitea 会自动处理映射,你在外网依然可以用 git.chgr.cc 拉取
|
||||||
images: git.chgr.cc/${{ github.repository }}
|
images: gitea:3000/${{ github.repository }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
|
|||||||
Reference in New Issue
Block a user