-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
clh
committed
Dec 3, 2024
1 parent
33ba12b
commit 9333b96
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy VitePress site to Pages | ||
|
||
on: | ||
push: | ||
# 推送任意tags或者master分支推送的时候触发任务 | ||
tags: | ||
- "*" | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-and-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "master" | ||
|
||
- name: Install yarn | ||
run: corepack enable | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
cache: "yarn" | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build Site | ||
run: npm run docs:build | ||
|
||
# 将文档产物提交到master分支 | ||
- name: Deploy for Github 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: master | ||
folder: docs/.vitepress/dist | ||
# enable single-commit to reduce the repo size | ||
single-commit: true | ||
clean: true |