Skip to content

Commit

Permalink
fix: 优化CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenny committed Jun 18, 2024
1 parent 2e1a3bf commit 54f648b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 77 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/doc-deploy.yml

This file was deleted.

48 changes: 28 additions & 20 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
on:
push:
branches:
- main
- publish

# 允许你从 Actions 选项卡手动运行此工作流程
workflow_dispatch:


# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
concurrency:
group: pages
cancel-in-progress: false

permissions:
contents: write
Expand All @@ -12,8 +22,6 @@ name: release-please
jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.output-release-created.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
Expand All @@ -26,21 +34,18 @@ jobs:
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
deploy-doc:
runs-on: ubuntu-latest

- name: Output Release Created
id: output-release-created
run: |
release_created=${{ steps.release.outputs.release_created }}
echo "release_created=$release_created" >> "$GITHUB_OUTPUT"
strategy:
matrix:
node-version: [21]

publish:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.release_created }}
steps:

- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Node Modules
id: cache-node-modules
Expand All @@ -52,16 +57,19 @@ jobs:
${{ runner.os }}-node-
- name: Setup Pnpm
id: setup-pnpm
uses: pnpm/action-setup@v3

- name: Install Dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: pnpm install

- name: Build Lib
run: pnpm lib:build
- name: Build Site
run: pnpm docs:build

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy Site
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/.vitepress/dist
deploy_key: ${{ secrets.DEPLOY_KEY }}
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import '../../../style/input';
import '../../../style/card';
import '../../../style/input';
import '../../../style/image';
import '../../../style/image_preview';
import '../../../style/image-preview';
import CodePreview from '../../../src/app_components/CodePreview.vue';
import '../../../style/message';
import '../../../style/shadow';
import '../../../style/table';
import '../../../style/switch';
import '../../../style/form';
import '../../../style/form_item';
import '../../../style/form-item';

export default {
extends: DefaultTheme,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 54f648b

Please sign in to comment.