From 886b551d107346df076b477beb16e047880bbd97 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Thu, 22 Oct 2026 13:47:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(ci):=20=E8=BF=81=E7=A7=BB=E8=87=B3=20Gitea?= =?UTF-8?q?=20Actions=20=E8=87=AA=E5=8A=A8=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将多架构 Docker 镜像构建从 GitHub Actions 迁移到 Gitea Actions。 更新 Gitea 容器镜像仓库配置、远程地址和使用说明,并移除旧工作流。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- {.github => .gitea}/workflows/build.yml | 28 +++++++++---------------- README.md | 13 +++++++----- 2 files changed, 18 insertions(+), 23 deletions(-) rename {.github => .gitea}/workflows/build.yml (74%) diff --git a/.github/workflows/build.yml b/.gitea/workflows/build.yml similarity index 74% rename from .github/workflows/build.yml rename to .gitea/workflows/build.yml index abdaa02..f96ac8b 100644 --- a/.github/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,8 +10,8 @@ on: workflow_dispatch: env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + REGISTRY: git.openlocalpdf.com + IMAGE_NAME: ${{ gitea.repository }} jobs: build-arch: @@ -27,10 +27,6 @@ jobs: arch: arm64 runs-on: ${{ matrix.runner }} - permissions: - contents: read - packages: write - steps: - name: Checkout repository uses: actions/checkout@v4 @@ -38,12 +34,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to GitHub Container Registry + - name: Log in to Gitea Container Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} - name: Extract Docker metadata for platform id: meta @@ -56,7 +52,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/v') }} + type=raw,value=latest,enable=${{ gitea.ref == format('refs/heads/{0}', gitea.event.repository.default_branch) || startsWith(gitea.ref, 'refs/tags/v') }} - name: Build and push by architecture uses: docker/build-push-action@v5 @@ -71,17 +67,13 @@ jobs: merge-manifests: needs: build-arch runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Log in to GitHub Container Registry + - name: Log in to Gitea Container Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} - name: Extract Docker metadata for manifest list id: meta @@ -92,7 +84,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/v') }} + type=raw,value=latest,enable=${{ gitea.ref == format('refs/heads/{0}', gitea.event.repository.default_branch) || startsWith(gitea.ref, 'refs/tags/v') }} - name: Create and push multi-arch manifest env: diff --git a/README.md b/README.md index 04f50f2..3c5d25e 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,15 @@ docker build -t webman:8.2 . ``` -### GitHub Actions 自动构建与发布 +### Gitea Actions 自动构建与发布 -已配置 `.github/workflows/build.yml`。采用**混合原生双架构矩阵构建**: -- **`linux/amd64`**:由 GitHub 云端 `ubuntu-latest` 原生构建 +已配置 `.gitea/workflows/build.yml`。采用**混合原生双架构矩阵构建**: +- **`linux/amd64`**:由 Gitea Actions 的 `ubuntu-latest` Runner 原生构建 - **`linux/arm64`**:由组织 Self-Hosted ARM Runner 原生硬件全速构建 -- 自动合并生成多架构 Manifest 并发布到 GitHub Container Registry (GHCR): +- 自动合并生成多架构 Manifest 并发布到 Gitea Container Registry: -- **Registry**: `ghcr.io/ai567-com/webman-docker:latest`(或对应 tag 如 `:v1.0.0`) +- **Registry**: `git.openlocalpdf.com/gitea/webman-docker:latest` + (或对应 tag 如 `:v1.0.0`) +- 请在 Gitea 仓库的 Actions Secrets 中配置 `REGISTRY_TOKEN`,其需要具备 + 写入包(Package)的权限。 - 无论是在 x86_64 服务器、云主机还是本地 Apple Silicon / ARM 设备上,Docker 都会自动拉取匹配本机架构的镜像运行。