diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index a9f0edf..ec400ee 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -168,12 +168,6 @@ jobs: Auto-converted from main branch commit ${{ github.sha }} - Changes: - - Add functions/[[path]].js: Catch-all Pages Function handler - - Update src/index.js: Export handleRequest for Pages Function import - - Update wrangler.toml: Configure for Pages deployment (no observability) - - Update package.json: Change scripts to use Pages commands - Runtime files only (documentation, tests, and dev configs excluded)." - name: Force push to pages branch @@ -367,16 +361,10 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git checkout -b functions git add . - git commit -m "Convert Workers to Vercel Functions + git commit -m "Convert Workers to Functions Auto-converted from main branch commit ${{ github.sha }} - Changes: - - Add api/index.js: Vercel Edge Function adapter - - Add vercel.json: Vercel routing and headers configuration - - Update src/index.js: Export handleRequest for Vercel adapter import - - Update package.json: Change scripts to use Vercel commands - Runtime files only (documentation, tests, and dev configs excluded)." - name: Force push to functions branch diff --git a/README.en.md b/README.en.md index cffa828..a1ccc01 100644 --- a/README.en.md +++ b/README.en.md @@ -7,6 +7,7 @@ [](#deploy-to-cloudflare-workers) [](#deploy-to-edgeone-pages) +[](#deploy-to-vercel) [](#self-hosted-deployment) [](#self-hosted-deployment) [](#-ecosystem-integration) @@ -2372,6 +2373,28 @@ client = OpenAI( **Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow. +### Deploy to Vercel + +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) + +2. **Get Vercel Token**: + - Visit [Vercel Account Settings](https://vercel.com/account/settings/tokens) to create and note an Access Token + +3. **Configure GitHub Secrets**: + - Go to your GitHub repository → Settings → Secrets and variables → Actions + - Add the following secret: + - `VERCEL_TOKEN`: Your Vercel Access Token + +4. **Trigger deployment**: + - The repository will automatically convert Workers code to Vercel Functions-compatible format and sync to the `functions` branch + - Pushing code to the `main` branch will automatically trigger sync and deployment workflows + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page + +5. **Bind custom domain** (optional): Bind your custom domain in the Vercel console + +**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. + ### Self-Hosted Deployment If you prefer to run Xget on your own server, you can use Docker or Podman deployment: diff --git a/README.md b/README.md index 4643f0e..e77f4ba 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [](#部署到-cloudflare-workers) [](#部署到-edgeone-pages) +[](#部署到-vercel) [](#自托管部署) [](#自托管部署) [](#-生态系统集成) @@ -2320,7 +2321,7 @@ client = OpenAI( 1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) 2. **获取 Cloudflare 凭证**: - - 访问[帐户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 + - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID 3. **配置 GitHub Secrets**: @@ -2341,7 +2342,7 @@ client = OpenAI( 1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) 2. **获取 Cloudflare 凭证**: - - 访问[帐户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 + - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID 3. **配置 GitHub Secrets**: @@ -2382,6 +2383,28 @@ client = OpenAI( **注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。 +### 部署到 Vercel + +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) + +2. **获取 Vercel Access Token**: + - 访问 [Vercel 账户设置](https://vercel.com/account/settings/tokens) 创建并记录 Access Token + +3. **配置 GitHub Secrets**: + - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions + - 添加以下 secret: + - `VERCEL_TOKEN`:你的 Vercel Access Token + +4. **触发部署**: + - 存储库会自动将 Workers 代码转换为 Vercel Functions 兼容格式并同步到 `functions` 分支 + - 推送代码到 `main` 分支会自动触发同步和部署工作流 + - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 + - 也可以在 GitHub Actions 页面手动触发部署 + +5. **绑定自定义域名**(可选):在 Vercel 控制台中绑定你的自定义域名 + +**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 + ### 自托管部署 如果你希望在自己的服务器上运行 Xget,可以使用 Docker 或 Podman 部署: @@ -2486,7 +2509,7 @@ podman compose up -d 部署完成后,Xget 将在 8080 端口运行。 -如果你希望在 DigitalOcean 上部署和运行 Xget,可以参考文档[《Deploying and Optimizing Xget on DigitalOcean》](docs/deploy-on-digitalocean.md)。通过下方推荐链接注册账号,可获得 200 美元代金券积分,可用于创建 Droplet、Kubernetes、App Platform 等资源: +如果你希望在 DigitalOcean 上部署和运行 Xget,可以参考文档[《Deploying and Optimizing Xget on DigitalOcean》](docs/deploy-on-digitalocean.md)。通过下方推荐链接注册账户,可获得 200 美元代金券积分,可用于创建 Droplet、Kubernetes、App Platform 等资源: