feat: 调整发布脚本
This commit is contained in:
@@ -11,18 +11,6 @@ on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# Build job
|
||||
build:
|
||||
@@ -31,19 +19,39 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Not needed if lastUpdated is not enabled
|
||||
# 根据网上资料查询此处可以设置为 false。<https://github.com/actions/checkout>
|
||||
persist-credentials: false
|
||||
|
||||
# Install Node.js
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm # or pnpm / yarn
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
|
||||
# - name: Setup Pages
|
||||
# uses: actions/configure-pages@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install # or pnpm install / yarn install / bun install
|
||||
|
||||
- name: Build with VitePress
|
||||
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
|
||||
# 部署到GitHub Pages - 也就是将打包内容发布到GitHub Pages
|
||||
- name: Deploy
|
||||
# 使用别人写好的 actions去部署(将打包文件部署到指定分支上)
|
||||
uses: JamesIves/github-pages-deploy-action@v4.3.3
|
||||
# 自定义环境变量
|
||||
with:
|
||||
path: .vitepress/dist
|
||||
# 指定仓库:你要发布的仓库路径名
|
||||
repository-name: CoderLambert/md-docs
|
||||
# 部署到 deploy-pages 分支,也就是部署后提交到那个分支
|
||||
branch: deploy-pages
|
||||
# 填写打包好的目录名称路径,本项目配置在根目录
|
||||
folder: dist
|
||||
|
||||
# - name: Upload artifact
|
||||
# uses: actions/upload-pages-artifact@v3
|
||||
# with:
|
||||
# path: .vitepress/dist
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
node_modules/
|
||||
.vitepress/cache/
|
||||
.vitepress/dist/
|
||||
.vitepress/dist/
|
||||
dist/
|
||||
@@ -50,12 +50,14 @@ const mdFiles = sideBarFiles.filter((file) => path.extname(file) === ".md").map(
|
||||
return { text: file.replace(".md", ""), link: `/${file}` };
|
||||
});
|
||||
|
||||
console.log(mdFiles);
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
title: "架构整洁之道",
|
||||
description: "vitepress 线上阅读构建",
|
||||
srcDir: 'docs',
|
||||
base: "/md-docs/",
|
||||
outDir: 'dist',
|
||||
themeConfig: {
|
||||
|
||||
aside: false,
|
||||
|
||||
Reference in New Issue
Block a user