Skip to content

Commit

Permalink
ci: 更新工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Aug 2, 2023
1 parent f957b51 commit 433e90c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 7 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Fighting Design Build Docs

# 当 master 分支 push 代码
# 并且 'packages/fighting-design/package.json' 文件修改的时候
on:
push:
branches:
- master
paths:
- 'packages/fighting-design/package.json'

jobs:
build-deploy:
runs-on: ubuntu-latest

steps:
# 下载仓库代码 / 校验
- name: Checkout
# actions/checkout@v3 是 github 官方的一个action,用于 clone 该仓库的源码到工作流中
uses: actions/checkout@v3

# 安装 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 6

# 安装 node pnpm
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'pnpm'

# 安装依赖项
- name: Install
run: pnpm i

# 打包文档
- name: Build docs
run: pnpm build:docs

# 向 Codecov 报告覆盖率
- name: Report coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

# https://github.com/peaceiris/actions-gh-pages#readme
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
7 changes: 0 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,3 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

# https://github.com/peaceiris/actions-gh-pages#readme
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist

0 comments on commit 433e90c

Please sign in to comment.