Compare commits

...
9 Commits
Author SHA1 Message Date
AntigravityandCopilot aabbf2abac fix(ci): 更新 Gitea Runner 与镜像标签规则
Build and Push Multi-Arch Docker Image / build-arch (amd64, linux/amd64, amd64) (push) Failing after 3m41s
Build and Push Multi-Arch Docker Image / build-arch (arm64, linux/arm64, arm64) (push) Failing after 5m38s
Build and Push Multi-Arch Docker Image / merge-manifests (push) Skipped
将多架构构建切换到 amd64 和 arm64 Runner,
并明确 master、main 分支及版本标签的 latest 镜像规则。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:23:24 +08:00
AntigravityandCopilot 886b551d10 feat(ci): 迁移至 Gitea Actions 自动构建
将多架构 Docker 镜像构建从 GitHub Actions 迁移到 Gitea Actions。
更新 Gitea 容器镜像仓库配置、远程地址和使用说明,并移除旧工作流。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 13:47:46 +08:00
Antigravity ca2ba8b08d feat: Dockerfile 中增加 imagick 扩展支持 2026-09-20 09:19:44 +08:00
Antigravity e2f1d0ba23 ci: 为架构后缀启用onlatest=true以生成latest架构镜像 2026-09-19 16:09:43 +08:00
Antigravity 2897b8c547 ci: 修复合并清单步骤中的多行标签变量语法 2026-09-19 16:03:13 +08:00
Antigravity 8a498987b2 ci: 将自建节点运行标签匹配调整为大写ARM64 2026-09-19 15:54:21 +08:00
Antigravity 88b4f97a26 ci: 启用混合原生双架构构建 (GitHub构建amd64, 自建ARM节点构建arm64) 2026-09-19 15:45:41 +08:00
Antigravity 081ae5a903 ci: switch build platform to linux/amd64 only for fast build 2026-09-19 14:30:59 +08:00
Antigravity 1291fd1381 ci: switch from gitea to github actions multi-arch build 2026-09-19 14:12:17 +08:00
5 changed files with 111 additions and 61 deletions

No files matched your search

-57
View File
@@ -1,57 +0,0 @@
name: Build and Push Docker Image
on:
push:
branches:
- master
- main
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
run: |
git clone --depth=1 "https://${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}@git.openlocalpdf.com/${{ gitea.repository }}.git" .
git checkout "${{ github.sha }}" || true
- name: Check Runner Environment
run: |
echo "=== System Info ==="
uname -a || true
which docker || echo "docker CLI not found!"
docker version || echo "docker daemon not accessible!"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.openlocalpdf.com -u "${{ gitea.actor }}" --password-stdin
- name: Build and Push Docker image (Multi-Arch)
run: |
IMAGE_NAME="git.openlocalpdf.com/${{ gitea.repository }}"
TAGS="-t ${IMAGE_NAME}:latest"
# 如果是 tag 触发,则同时打上具体版本 tag
if [ "${{ github.ref_type }}" = "tag" ]; then
TAG_NAME="${{ github.ref_name }}"
echo "Tag detected: ${TAG_NAME}"
TAGS="${TAGS} -t ${IMAGE_NAME}:${TAG_NAME}"
fi
echo "Building and pushing multi-arch image: ${TAGS}"
docker buildx build \
--platform linux/amd64,linux/arm64 \
${TAGS} \
--push \
-f Dockerfile .
+99
View File
@@ -0,0 +1,99 @@
name: Build and Push Multi-Arch Docker Image
on:
push:
branches:
- master
- main
tags:
- 'v*'
workflow_dispatch:
env:
REGISTRY: git.openlocalpdf.com
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-arch:
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: amd64 # 香港 runner,原生编译
arch: amd64
- platform: linux/arm64
runner: arm64 # 本机 runner,原生编译
arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract Docker metadata for platform
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=-${{ matrix.arch }},onlatest=true
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/master' || gitea.ref == 'refs/heads/main' || startsWith(gitea.ref, 'refs/tags/v') }}
- name: Build and push by architecture
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
merge-manifests:
needs: build-arch
runs-on: amd64
steps:
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract Docker metadata for manifest list
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/master' || gitea.ref == 'refs/heads/main' || startsWith(gitea.ref, 'refs/tags/v') }}
- name: Create and push multi-arch manifest
env:
TAGS: ${{ steps.meta.outputs.tags }}
run: |
for tag in ${TAGS}; do
echo "Creating manifest for $tag..."
docker buildx imagetools create -t "$tag" \
"${tag}-amd64" \
"${tag}-arm64"
docker buildx imagetools inspect "$tag"
done
+1
View File
@@ -3,3 +3,4 @@ Thumbs.db
*.log *.log
.codegraph/ .codegraph/
.omo/ .omo/
.idea/
+1
View File
@@ -27,6 +27,7 @@ RUN install-php-extensions \
pdo_mysql \ pdo_mysql \
redis \ redis \
gd \ gd \
imagick \
zip \ zip \
bcmath \ bcmath \
opcache \ opcache \
+10 -4
View File
@@ -17,9 +17,15 @@
docker build -t webman:8.2 . docker build -t webman:8.2 .
``` ```
### Gitea CI/CD 自动构建 ### Gitea Actions 自动构建与发布
已配置 `.gitea/workflows/build.yaml`。每次推送到 `master` / `main` 或推送 tag(如 `v1.0.0`)时,Gitea Actions 会自动构建并推送到 Gitea 镜像仓库: 已配置 `.gitea/workflows/build.yml`。采用**混合原生双架构矩阵构建**:
- **`linux/amd64`**:由 Gitea Actions 的 `ubuntu-latest` Runner 原生构建
- **`linux/arm64`**:由组织 Self-Hosted ARM Runner 原生硬件全速构建
- 自动合并生成多架构 Manifest 并发布到 Gitea Container Registry:
- **Registry**: `git.openlocalpdf.com:222/gitea/webman-docker:latest` - **Registry**: `git.openlocalpdf.com/gitea/webman-docker:latest`
- 确保 Gitea 仓库已启用 Actions 且部署有对应 Runner(如 act_runner)。 (或对应 tag 如 `:v1.0.0`)
- 请在 Gitea 仓库的 Actions Secrets 中配置 `REGISTRY_TOKEN`,其需要具备
写入包(Package)的权限。
- 无论是在 x86_64 服务器、云主机还是本地 Apple Silicon / ARM 设备上,Docker 都会自动拉取匹配本机架构的镜像运行。