Skip to content

Commit

Permalink
ci: 更新 ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Jul 31, 2023
1 parent d5c48e4 commit 3008d73
Showing 1 changed file with 67 additions and 5 deletions.
72 changes: 67 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Fighting Design Github Actions

# 当 master 分支 push 代码的时候触发 workflow
on:
push:
branches:
Expand All @@ -13,7 +12,6 @@ jobs:
steps:
# 下载仓库代码 / 校验
- name: Checkout
# actions/checkout@v3 是 github 官方的一个action,用于 clone 该仓库的源码到工作流中
uses: actions/checkout@v3

# 安装 pnpm
Expand Down Expand Up @@ -41,9 +39,15 @@ jobs:
- name: Build components
run: pnpm build

# 打打包文档
- name: Build docs
run: pnpm build:docs
# 打打包文档,并移动产物到新分支
- name: Build and Move docs
run: |
pnpm build:docs
mkdir -p docs/docs/.vitepress/dist
mv -f build_output_directory/* docs/docs/.vitepress/dist/
git add -A
git commit -m "Move build artifacts to docs-web branch"
git push origin docs-web
# 向 Codecov 报告覆盖率
- name: Report coverage to Codecov
Expand All @@ -56,3 +60,61 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/docs/.vitepress/dist
# name: Fighting Design Github Actions

# # 当 master 分支 push 代码的时候触发 workflow
# on:
# push:
# branches:
# - master

# 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: 7.17.1

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

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

# # 单元测试
# - name: Test
# run: pnpm test

# # 打包组件
# - name: Build components
# run: pnpm build

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

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

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

0 comments on commit 3008d73

Please sign in to comment.