Skip to content

Commit 76e443a

Browse files
committed
ci: 添加文档部署
- Build job: 构建项目 - Publish job: 发布到 npm (tag 触发) - Deploy-docs job: 部署文档到 GitHub Pages
1 parent 4f4674b commit 76e443a

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Publish
1+
name: Build, Publish and Deploy
22

33
on:
44
push:
@@ -64,3 +64,25 @@ jobs:
6464
release_name: TaskFlow AI ${{ github.ref }}
6565
draft: false
6666
prerelease: false
67+
68+
deploy-docs:
69+
needs: build
70+
runs-on: ubuntu-latest
71+
if: github.ref == 'refs/heads/main'
72+
steps:
73+
- uses: actions/checkout@v4
74+
with:
75+
ref: main
76+
77+
- name: Download artifact
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: dist
81+
path: dist/
82+
83+
- name: Deploy to GitHub Pages
84+
uses: peaceiris/actions-gh-pages@v3
85+
with:
86+
github_token: ${{ secrets.GITHUB_TOKEN }}
87+
publish_dir: ./docs/.vitepress/dist
88+
publish_branch: gh-pages

0 commit comments

Comments
 (0)