Files
AntiCaptcha/.gitea/workflows/build.yml
T
Hermes 5e9cabeb2f
Build and Push / build (push) Successful in 4m22s
ci: 镜像改推 reg.viaeon.com(灰云直连),并移除会覆盖线上 compose 的 deploy 作业
为什么要换推送入口:
  git.viaeon.com 在 Cloudflare 橙云后面,CF 对请求体有 100MB 上限;
  Dockerfile 里 opencv 运行库那一层超过 100MB,任何一次缓存失效都会让 push
  被拦成 413 Payload Too Large(本次修 bug 时已经踩到两次)。

做法:
  · 新建 reg.viaeon.com(Cloudflare 只有灰云 A 记录 → 54.39.129.3,不经 CF)
  · leb 上加 nginx 站点:client_max_body_size 0、关 buffering、反代 127.0.0.1:3000
  · acme.sh + Cloudflare DNS-01 签 LE 证书(装到站点 config/,reloadcmd reload nginx,
    acme 自带续期 cron;ARI 续期窗口 2027-01-31)
  · CI 改为 login/push reg.viaeon.com/admin/anticaptcha:latest
  · 仓库路径不变(admin/anticaptcha),线上仍用 git.viaeon.com 拉取

实测:710MB 镜像经 reg.viaeon.com push 成功(大层不再 413),
      再用 git.viaeon.com 拉同一 tag,digest 一致,证明两个入口是同一个 registry。

顺带删掉 deploy 作业:它会重写 docker-compose.yml,写回
JWT_SECRET=anticaptcha-fixed-jwt-secret-2024 和 "6688:6688"(0.0.0.0 公网绑定),
一旦跑起来会把线上的密钥轮换和「只绑 127.0.0.1」全部覆盖掉。
2026-12-03 09:14:12 +08:00

57 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build and Push
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build frontend
working-directory: ./web
run: |
npm install
npm run build
- name: Setup Docker
uses: docker/setup-buildx-action@v3
# 推镜像走 reg.viaeon.com:它是同一个 Gitea registry 的「灰云」直连入口。
# git.viaeon.com 在 Cloudflare 橙云后面,CF 对请求体有 100MB 上限,
# opencv 运行库那一层就超过 100MB,push 会被 CF 拦成 413 Payload Too Large。
# 推上去的仓库路径仍是 admin/anticaptcha,所以线上照旧用
# git.viaeon.com/admin/anticaptcha:latest 拉取即可。
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: reg.viaeon.com
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: reg.viaeon.com/admin/anticaptcha:latest
# 部署不在 CI 里做:原来那个 deploy 步骤会把 docker-compose.yml 重写成
# JWT_SECRET=anticaptcha-fixed-jwt-secret-2024 且 6688 绑 0.0.0.0(公网裸奔),
# 会把线上的密钥轮换与「只绑 127.0.0.1」全部覆盖掉。
# 线上更新方式(在 leb 上执行):
# cd /opt/ace/compose/AntiCaptcha && docker compose pull && docker compose up -d