Skip to content

Commit 8799580

Browse files
committed
配置 GitHub Pages 部署
1 parent 25fd80c commit 8799580

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

deploy.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env sh
2+
3+
# 确保脚本抛出遇到的错误
4+
set -e
5+
6+
# 加载 nvm
7+
export NVM_DIR="$HOME/.nvm"
8+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
9+
nvm use 20
10+
11+
# 生成静态文件
12+
npm run build
13+
14+
# 进入生成的文件夹
15+
cd docs/.vuepress/dist
16+
17+
# 如果是发布到自定义域名
18+
# echo 'www.example.com' > CNAME
19+
20+
git init
21+
git add -A
22+
git commit -m 'deploy'
23+
24+
# 如果发布到 https://<USERNAME>.github.io/<REPO>
25+
git push -f https://github.com/nbtca/Minecraft.git master:gh-pages
26+
27+
cd -

0 commit comments

Comments
 (0)