部署vuepress项目到githubPage

部署vuepress项目到githubPage

1. 项目文件夹下有两个分支(main和gh-page)

1.1 main分支存放项目代码

1.2 gh-page分支存放 npm run docs:build之后的dist里面的所有文件

2. 分别提交到github上

3. 你的项目/docs/.vuepress/config.js

复制代码
   module.exports = {
     title: 'vuePress',
     description: 'VuePress GitHub Actions',
     base: '/yt-ui-doc/', // 必须配置正确
     repo: 'https://programmermao-001.github.io/yt-ui-doc/', // 远程仓库地址
     plugins: [
   	'vuepress-plugin-mermaidjs'
     ],
     themeConfig: {
       // ...
     }
   }

4. 你的项目/deploy.sh

复制代码
   #!/usr/bin/env sh
   
   # 当发生错误时中止脚本
   set -e
   
   # 构建
   npm run build
   
   # cd 到构建输出的目录下
   cd dist
   
   # 部署到自定义域域名
   # echo 'www.example.com' > CNAME
   
   git init
   git add -A
   git commit -m 'deploy'
   
   # 部署到 https://<USERNAME>.github.io
   # git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
   
   # 部署到 https://<USERNAME>.github.io/<REPO>
   # 将下面这行替换成自己的仓库地址
   git push -f git@github.com:ProgrammerMao-001/yt-ui-doc.git master:gh-pages   
   cd -

5. 上github.com找到自己的项目

5.1 Settings

5.2 Pages

5.3 Branch 选择 gh-page分支 / (root)文件夹

5.4 保存

6. 发布成功 例如我的

相关推荐
zandy10115 分钟前
网络支付合规三重门:Kimi Code、Cursor、GitHub Copilot等五款AI编程工具国内实战测评
github·copilot·ai编程
ssshooter2 小时前
Tauri + GitHub Actions 自动化发布 Android APK 技术总结
android·github·android studio
wdfk_prog2 小时前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github
Da Zeng4 小时前
快速搭建GitHub Page
github
明月_清风4 小时前
GitHub Actions 从入门到实战:一文搞懂 CI/CD 自动化
后端·ci/cd·github
QUOR4 小时前
Zorv AI 终端:基于 proot 沙箱的 Android 终端模拟器架构全解析
github
其实防守也摸鱼5 小时前
ZLibrary 类项目合规避坑指南:从技术实现到法律风险的全景梳理
运维·服务器·数据库·安全·自动化·github·copilot
今天AI了吗6 小时前
AI工作流的自动化趋势:从手动实验到自主Agent的研究范式转变
运维·数据库·人工智能·sql·机器学习·自动化·github
m4Rk_8 小时前
【论文阅读】Agent 记忆机制(53):Experience-Following——为什么错误经验会在记忆中不断传播
论文阅读·人工智能·学习·开源·github
峰向AI1 天前
Superpower 不是最「聪明」的,这个开源项目让模型学会资深工程师的肌肉记忆
github