> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 自定义节点 CI/CD

> 在发布前使用 Comfy-Action 在 GitHub Actions 上运行工作流，测试 ComfyUI 自定义节点，并在 CI/CD Dashboard 中查看结果。

## 简介

在对自定义节点进行更改时，在 Comfy 或其他自定义节点中出现问题并不罕见。在每种操作系统和不同的 Pytorch 配置上进行测试通常是不现实的。

### 使用 Github Actions 运行 Comfy 工作流

[Comfy-Action](https://github.com/Comfy-Org/comfy-action) 允许您在 Github Actions 上运行 Comfy workflow\.json 文件。它支持下载模型、自定义节点，并可在 Linux/Mac/Windows 上运行。

### 结果

输出文件会上传到 [CI/CD 仪表板](https://ci.comfy.org/)，可以在提交新更改或发布自定义节点的新版本之前作为最后一步查看。

![ComfyCI](https://mintcdn.com/dripart/Rig0_LOInmwVbVSB/images/comfyci.png?fit=max\&auto=format\&n=Rig0_LOInmwVbVSB\&q=85\&s=443608968123247168b89b026ed2ae0e)

### 使用 GitHub Actions 发布版本

[Publish Node Action](https://github.com/Comfy-Org/node-publish-action) 会把 `pyproject.toml` 中的版本发布到 Registry，因此只要更新版本号就可以发版。先在 **Settings** > **Secrets and variables** > **Actions** 中添加名为 `REGISTRY_ACCESS_TOKEN` 的仓库密钥（内容为你的 Registry 访问令牌），然后添加以下工作流：

```yaml theme={null}
name: Publish to Comfy registry
on:
  workflow_dispatch:
  push:
    branches:
      - main
    paths:
      - "pyproject.toml"

jobs:
  publish-node:
    name: Publish Custom Node to registry
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v4
      - name: Publish Custom Node
        uses: Comfy-Org/publish-node-action@main
        with:
          personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
```

> [!NOTE]
>
> 发布的版本取自 `pyproject.toml` 的 `version` 字段，请在运行工作流前更新它。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.