-
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.
✨ feat: deploy github page version 2
- Loading branch information
Showing
8 changed files
with
4,455 additions
and
8 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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"hash": "4a6ab71d", | ||
"browserHash": "428fc6fa", | ||
"hash": "e6761ca9", | ||
"browserHash": "987682f0", | ||
"optimized": { | ||
"vue": { | ||
"src": "../../../node_modules/.pnpm/[email protected]/node_modules/vue/dist/vue.runtime.esm-bundler.js", | ||
"file": "vue.js", | ||
"fileHash": "aab0901c", | ||
"fileHash": "2cf0f4fe", | ||
"needsInterop": false | ||
}, | ||
"element-plus": { | ||
"src": "../../../node_modules/.pnpm/[email protected][email protected]/node_modules/element-plus/es/index.mjs", | ||
"file": "element-plus.js", | ||
"fileHash": "70259424", | ||
"fileHash": "bf93ae97", | ||
"needsInterop": false | ||
}, | ||
"xing-ly": { | ||
"src": "../../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/xing-ly/dist/xing-ly.es.js", | ||
"file": "xing-ly.js", | ||
"fileHash": "670dd4c9", | ||
"fileHash": "28b254c1", | ||
"needsInterop": false | ||
} | ||
}, | ||
|
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
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
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,37 @@ | ||
--- | ||
title: GitHub pages2 | ||
layout: doc | ||
--- | ||
# GitHub pages2 | ||
第二种配置自动部署方式 | ||
## 1. 创建新仓库 | ||
1. 创建一个新的仓库放置打包的文件 | ||
> 将仓库命名为 `<username>.github.io` -username 为用户名 | ||
## 2. 配置脚本 | ||
在项目的根目录下 deploy.sh 文件中添加如下脚本 | ||
```sh | ||
#!/usr/bin/env sh | ||
# 打包项目 | ||
pnpm run docs:build | ||
# 切换到dist目录 | ||
cd .vitepress/dist/ | ||
# 将打包文件提交到新仓库中 | ||
git init | ||
git add . | ||
git commit -m 'deploy' | ||
git push -f [email protected]:xing403/xing403.github.io.git master | ||
``` | ||
## 3. 配置script 命令 | ||
在 package.json 文件中添加如下命令 | ||
```json | ||
{ | ||
"scripts": { | ||
"deploy:github": "deploy.sh" | ||
} | ||
} | ||
``` | ||
## 4. 本地执行 | ||
在项目根目录下执行 | ||
```sh | ||
pnpm run deploy:github | ||
``` |
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,18 @@ | ||
#!/usr/bin/env sh | ||
|
||
# 打包生成静态文件 | ||
echo start build | ||
pnpm run docs:build | ||
echo start build end | ||
|
||
# 进入待发布的 dist/ 目录 | ||
cd .vitepress/dist/ | ||
echo commit build files to git | ||
|
||
|
||
git init | ||
git add . | ||
git commit -m 'deploy' | ||
echo git push -f [email protected]:xing403/xing403.github.io.git master | ||
git push -f [email protected]:xing403/xing403.github.io.git master | ||
echo finish |
Oops, something went wrong.