Go to file
asdfghjkl321 7ef9782e39
CI / build (push) Waiting to run Details
修改流水线:CI
2026-05-08 20:25:00 +08:00
.GitLink/workflows docs: GitLink actions UI needs New Pipeline; add gitlab-ci and import yaml 2026-05-08 20:14:00 +08:00
.gitea/workflows 创建流水线:CI 2026-05-08 20:23:51 +08:00
.github/workflows docs: GitLink actions UI needs New Pipeline; add gitlab-ci and import yaml 2026-05-08 20:14:00 +08:00
src feat: CI/CD workflows, Dockerfile, lockfile, master branch triggers 2026-05-08 19:43:02 +08:00
tests 添加 CI/CD 流水线配置 2026-05-08 14:40:22 +08:00
.eslintrc.json 添加 CI/CD 流水线配置 2026-05-08 14:40:22 +08:00
.gitignore 添加 CI/CD 流水线配置 2026-05-08 14:40:22 +08:00
.gitlab-ci.yml docs: GitLink actions UI needs New Pipeline; add gitlab-ci and import yaml 2026-05-08 20:14:00 +08:00
Dockerfile feat: CI/CD workflows, Dockerfile, lockfile, master branch triggers 2026-05-08 19:43:02 +08:00
README.md docs: add GHA-style YAML for GitLink pipeline PM editor 2026-05-08 20:22:38 +08:00
gitlink-ci-import.yml docs: GitLink actions UI needs New Pipeline; add gitlab-ci and import yaml 2026-05-08 20:14:00 +08:00
gitlink-pm-editor-ci.yml docs: add GHA-style YAML for GitLink pipeline PM editor 2026-05-08 20:22:38 +08:00
package-lock.json feat: CI/CD workflows, Dockerfile, lockfile, master branch triggers 2026-05-08 19:43:02 +08:00
package.json feat: CI/CD workflows, Dockerfile, lockfile, master branch triggers 2026-05-08 19:43:02 +08:00
test-setup.js 添加 CI/CD 流水线配置 2026-05-08 14:40:22 +08:00
tsconfig.json 添加 CI/CD 流水线配置 2026-05-08 14:40:22 +08:00

README.md

GitLink CI/CD Demo Projectdanshen/CI

一个用于演示 GitLink / GitHub Actions 风格 CI/CD 的示例项目。

项目结构

.
├── .github/workflows/       # GitLink 流水线轻量引擎version / type / trigger
│   ├── ci.yml
│   └── deploy-staging.yml
├── .GitLink/workflows/      # 与 .github/workflows 内容一致(任选其一目录保留即可,避免重复)
│   ├── ci.yml
│   └── deploy-staging.yml
├── Dockerfile
├── src/
├── tests/
├── package.json
├── package-lock.json        # 提交到 GitCI 里 npm ci 需要
├── .gitlab-ci.yml           # 若平台支持 GitLab CI推送后可能自动跑视 GitLink 而定)
├── gitlink-ci-import.yml    # 轻量引擎 version:2 格式(部分导入入口用)
├── gitlink-pm-editor-ci.yml # GitLink「流水线流程编排」编辑器pm.gitlink.org.cn里粘贴用
└── README.md

功能特性

  • greet(name): 生成问候语
  • add(a, b): 加法运算
  • isValidEmail(email): 邮箱验证

流水线页是「暂无数据」时(重要)

你在 https://gitlink.org.cn/danshen/CI/actions 看到的是 「暂无数据」 和蓝色 「新建流水线」 按钮。这说明:

当前 GitLink 不会在「流水线」列表里自动出现你在代码里放的 .github/workflows/*.yml
列表里的每一条流水线,通常要在网页上 点「新建流水线」 创建一次(配置保存在平台里),或按向导 从仓库导入 某个 YAML若界面提供该选项

请按下面顺序操作(名称以你页面上为准):

  1. 「新建流水线」
  2. 若向导里让填 流水线名称,例如填:CI
  3. 若有 关联仓库 / 分支,选本仓库 danshen/CI、分支 master
  4. 若有 「从仓库导入 YAML」/「选择配置文件」:选仓库里的 gitlink-ci-import.yml(与 .github/workflows/ci.yml 内容相同)。
  5. 若没有导入选项、而是 「图形化添加步骤」:依次添加等价步骤:检出代码 → Node 20 → 执行 npm cinpm run lintnpm run type-checknpm test -- --coverage
  6. 保存后回到 流水线(devops),应能看到刚建的流水线;再 推送一次 master 或点 「运行」 试跑。

仓库根目录已增加 .gitlab-ci.yml。若 GitLink 底层兼容 GitLab Runner有可能在 其它菜单如「构建」「CI 配置」)里出现自动流水线;以平台说明为准。

仓库里 YAML 说明(与网页「新建流水线」的关系)

文件 用途
.github/workflows/ci.yml GitLink 轻量引擎写法(version: 2 + trigger),供导入或文档对照
gitlink-ci-import.yml 同上,根路径便于在「从仓库选择文件」里选中
.gitlab-ci.yml 标准 GitLab CI若平台支持则可能在推送后自动执行

针对仓库 https://gitlink.org.cn/danshen/CI.git 的操作示例

你的 GitLink 项目页:danshen/CI(默认分支一般是 master)。流水线入口在顶部 「流水线(devops)」

1. 在本机绑定远程并推送PowerShell

在项目根目录执行(若已添加过 origin,先 git remote remove origin

cd d:\Litter\111
git remote add origin https://gitlink.org.cn/danshen/CI.git
git checkout -B master
git add -A
git status
git commit -m "chore: add CI/CD workflows and demo app"

若远程已有一次提交(例如只有 README.md),第一次推送前需要合并历史:

git pull origin master --allow-unrelated-histories
# 若有冲突按提示解决后git add -A && git commit -m "merge remote"
git push -u origin master

若你确认可以覆盖远程、只保留本地这一套代码:

git push -u origin master --force

2. 在网页上点哪里

  1. 打开:https://gitlink.org.cn/danshen/CI
  2. 代码库:确认 master 上已有最新提交。
  3. 流水线(devops):若仍为「暂无数据」,按上文 「流水线页是暂无数据时」「新建流水线」 创建。
  4. 仓库设置若有「CI / Runner / 构建」相关开关,按 GitLink 帮助 说明打开。

3. 分支说明

工作流里的 ref: refs/heads/master 只对 master 生效。改用 main 时,请把 ci.ymldeploy-staging.ymlgitlink-ci-import.yml 里的 ref 以及 .gitlab-ci.yml 里的 CI_COMMIT_BRANCH 规则一并改掉。


  1. 推送代码master(见上文 PowerShell
  2. 在流水线页用「新建流水线」建至少一条流水线(或导入 gitlink-ci-import.yml),否则列表会一直为空。
  3. 需要第二条「预发布构建」时,再建一条流水线或导入 deploy-staging 对应 YAML.github/workflows/deploy-staging.yml)。

开发命令

npm ci
npm run lint
npm run type-check
npm test
npm run build

许可证

MIT License