feat(ci): 迁移至 Gitea Actions 自动构建
将多架构 Docker 镜像构建从 GitHub Actions 迁移到 Gitea Actions。 更新 Gitea 容器镜像仓库配置、远程地址和使用说明,并移除旧工作流。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
ca2ba8b08d
commit
886b551d10
2 files changed
+18
-23
No files matched your search
@@ -10,8 +10,8 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: git.openlocalpdf.com
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ gitea.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-arch:
|
build-arch:
|
||||||
@@ -27,10 +27,6 @@ jobs:
|
|||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -38,12 +34,12 @@ 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 GitHub Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Extract Docker metadata for platform
|
- name: Extract Docker metadata for platform
|
||||||
id: meta
|
id: meta
|
||||||
@@ -56,7 +52,7 @@ jobs:
|
|||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
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
|
- name: Build and push by architecture
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
@@ -71,17 +67,13 @@ jobs:
|
|||||||
merge-manifests:
|
merge-manifests:
|
||||||
needs: build-arch
|
needs: build-arch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Extract Docker metadata for manifest list
|
- name: Extract Docker metadata for manifest list
|
||||||
id: meta
|
id: meta
|
||||||
@@ -92,7 +84,7 @@ jobs:
|
|||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
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
|
- name: Create and push multi-arch manifest
|
||||||
env:
|
env:
|
||||||
@@ -17,12 +17,15 @@
|
|||||||
docker build -t webman:8.2 .
|
docker build -t webman:8.2 .
|
||||||
```
|
```
|
||||||
|
|
||||||
### GitHub Actions 自动构建与发布
|
### Gitea Actions 自动构建与发布
|
||||||
|
|
||||||
已配置 `.github/workflows/build.yml`。采用**混合原生双架构矩阵构建**:
|
已配置 `.gitea/workflows/build.yml`。采用**混合原生双架构矩阵构建**:
|
||||||
- **`linux/amd64`**:由 GitHub 云端 `ubuntu-latest` 原生构建
|
- **`linux/amd64`**:由 Gitea Actions 的 `ubuntu-latest` Runner 原生构建
|
||||||
- **`linux/arm64`**:由组织 Self-Hosted ARM 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 都会自动拉取匹配本机架构的镜像运行。
|
- 无论是在 x86_64 服务器、云主机还是本地 Apple Silicon / ARM 设备上,Docker 都会自动拉取匹配本机架构的镜像运行。
|
||||||
Reference in new issue
Block a user