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 都会自动拉取匹配本机架构的镜像运行。