From 9988ab03b46849190fc01d5da5d635f4bc2046de Mon Sep 17 00:00:00 2001 From: Tyh2001 <1469442737@qq.com> Date: Mon, 31 Jul 2023 08:47:19 +0800 Subject: [PATCH] ci: ci --- .github/workflows/docs.yml | 55 ++++++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 28 +++++++++---------- 2 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..129a37db37 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,55 @@ +name: Fighting Design Build Docs + +on: + push: + branches: + - master + +jobs: + build-deploy: + runs-on: ubuntu-latest + + steps: + # 下载仓库代码 / 校验 + - name: Checkout + 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: 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 + 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 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f33e1d40de..a00f70cbf3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,15 +39,15 @@ jobs: - name: Build components run: pnpm build - # 打打包文档,并移动产物到新分支 - - 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 + # # 打打包文档,并移动产物到新分支 + # - 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 @@ -55,11 +55,11 @@ jobs: 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 + # - name: Deploy + # uses: peaceiris/actions-gh-pages@v3 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # publish_dir: docs/docs/.vitepress/dist # name: Fighting Design Github Actions # # 当 master 分支 push 代码的时候触发 workflow