瀏覽代碼

chore(cnb): 推送到 main 后自动同步到 Gogs 镜像(需配 GOGS_USER / GOGS_TOKEN 变量)

wangshuo 6 小時之前
父節點
當前提交
6a7c219805
共有 1 個文件被更改,包括 16 次插入 和 0 次删除
  1. 16 0
      .cnb.yml

+ 16 - 0
.cnb.yml

@@ -0,0 +1,16 @@
+# CNB 流水线:推送到 main 之后,自动把仓库同步到公司 Gogs 镜像。
+# 这样「只推一个源(CNB)」即可,Gogs 自动跟随。
+# 需要两个仓库级变量(CNB 仓库设置 → 环境变量/密钥):
+#   GOGS_USER    = wangshuo
+#   GOGS_TOKEN   = <Gogs 访问令牌/密码>
+main:
+  push:
+    - stages:
+        - name: sync to gogs mirror
+          image: tencentcom/git-sync
+          settings:
+            target_url: http://49.235.130.76/TeamPLT/Gallery.git
+            auth_type: https
+            username: ${GOGS_USER}
+            password: ${GOGS_TOKEN}
+            force: true