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