Skip to content

Commit

Permalink
feat(ci): 添加更新主题包并部署到 Cloudflare Pages的工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Sep 21, 2024
1 parent e43c14b commit a2971d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 51 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,41 @@ name: 部署到 Cloudflare Pages
on:
push:
branches:
- 'main' # 当推送到 main 分支时触发
- 'main'
workflow_dispatch:
inputs:
theme_version:
description: '指定的主题包版本'
required: false
default: 'prerelease'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
# 第一步:检出代码
- name: 检出代码
uses: actions/checkout@v3
with:
fetch-depth: 0

# 第二步:安装 pnpm
- name: 安装 pnpm
uses: pnpm/action-setup@v3
with:
version: latest

# 第三步:安装依赖
- name: 安装依赖
run: pnpm install

# 第四步:构建项目
- name: 更新主题包
run: pnpm update @project-trans/vitepress-theme-project-trans@${{ github.event.inputs.theme_version }}

- name: 构建项目
run: pnpm build # 构建 VitePress 项目

# 第五步:安装 Wrangler
- name: 安装 Wrangler
run: pnpm add -g wrangler@3 # 安装 Wrangler v3

# 第六步:发布到 Cloudflare Pages
- name: 发布到 Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/update-and-build.yml

This file was deleted.

0 comments on commit a2971d0

Please sign in to comment.