parent
82f9926a7d
commit
8f81a1c82d
|
@ -14,45 +14,40 @@ on:
|
|||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
steps:
|
||||
# 第一步:检出代码
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# 第二步:安装 pnpm
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
# 第三步:安装 node 并配置缓存
|
||||
- name: 设置 Node.js 环境
|
||||
uses: actions/setup-node@v4
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
node-version: 'latest'
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
cache: 'pnpm'
|
||||
version: latest
|
||||
|
||||
# 第四步:安装依赖
|
||||
# 第三步:安装依赖
|
||||
- name: 安装依赖
|
||||
run: pnpm install
|
||||
|
||||
- name: 更新主题包
|
||||
run: pnpm update @project-trans/vitepress-theme-project-trans@prerelease
|
||||
|
||||
# 第五步:构建项目
|
||||
# 第四步:构建项目
|
||||
- name: 构建项目
|
||||
run: pnpm build # 构建 VitePress 项目
|
||||
|
||||
# 第五步:安装 Wrangler
|
||||
- name: 安装 Wrangler
|
||||
run: pnpm add -g wrangler@3 # 安装 Wrangler v3
|
||||
|
||||
# 第六步:发布到 Cloudflare Pages
|
||||
- name: 发布到 Cloudflare Pages
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
uses: cloudflare/pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} # Cloudflare Pages API Token
|
||||
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }} # Cloudflare 账户 ID
|
||||
command: pages deploy docs/.vitepress/dist --project-name=rle-wiki
|
||||
# Optional: Enable this if you want to have GitHub Deployments triggered
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectName: rle-wiki # Cloudflare Pages 项目名称
|
||||
directory: docs/.vitepress/dist # 构建输出目录
|
||||
|
|
|
@ -4,9 +4,9 @@ on:
|
|||
pull_request_target:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
paths:
|
||||
- "docs/**"
|
||||
- "package.json"
|
||||
- "packages/**"
|
||||
- 'docs/**'
|
||||
- 'package.json'
|
||||
- 'packages/**'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
@ -29,26 +29,20 @@ jobs:
|
|||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
# 第四步:安装 node 并配置缓存
|
||||
- name: 设置 Node.js 环境
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "latest"
|
||||
registry-url: "https://registry.npmjs.org/"
|
||||
cache: "pnpm"
|
||||
|
||||
# 第五步:安装依赖
|
||||
# 第四步:安装依赖
|
||||
- name: 安装依赖
|
||||
run: pnpm install
|
||||
|
||||
- name: 更新主题包
|
||||
run: pnpm update @project-trans/vitepress-theme-project-trans@prerelease
|
||||
|
||||
# 第六步:构建项目
|
||||
# 第五步:构建项目
|
||||
- name: 构建项目
|
||||
run: pnpm build # 构建 VitePress 项目
|
||||
|
||||
# 第六步:发布到 Cloudflare Pages
|
||||
- name: 安装 Wrangler
|
||||
run: npm install -g wrangler@^3.90.0
|
||||
|
||||
- name: Deploy to Cloudflare Pages
|
||||
id: deploy
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
|
|
|
@ -11,25 +11,17 @@ on:
|
|||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: 设置 Node.js 环境
|
||||
uses: actions/setup-node@v4
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
node-version: 'latest'
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
cache: 'pnpm'
|
||||
version: latest
|
||||
|
||||
- name: 安装依赖
|
||||
run: pnpm install
|
||||
|
@ -40,11 +32,13 @@ jobs:
|
|||
- name: 构建项目
|
||||
run: pnpm build # 构建 VitePress 项目
|
||||
|
||||
- name: 安装 Wrangler
|
||||
run: pnpm add -g wrangler@3 # 安装 Wrangler v3
|
||||
|
||||
- name: 发布到 Cloudflare Pages
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
uses: cloudflare/pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} # Cloudflare Pages API Token
|
||||
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }} # Cloudflare 账户 ID
|
||||
command: pages deploy docs/.vitepress/dist --project-name=rle-wiki
|
||||
# Optional: Enable this if you want to have GitHub Deployments triggered
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectName: rle-wiki # Cloudflare Pages 项目名称
|
||||
directory: docs/.vitepress/dist # 构建输出目录
|
||||
|
|
Loading…
Reference in New Issue