部署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. 发布成功 例如我的

相关推荐
troy1284 小时前
Python 基础语法(九):Django/Flask/FastAPI 三大 Web 框架详细对比解析
python·jupyter·django·flask·github·fastapi
dong_junshuai8 小时前
每天一个开源项目#103 BrowserSkill:4.7K星,Agent接管真实浏览器
开源·github·agent
dong_junshuai8 小时前
每天一个开源项目#102 六阶段代码复核流程范式
开源·github·agent
峰向AI8 小时前
别再给 AI 助手单独付费了,腾讯开源 3.6K 星标的全家共享平台
github
逛逛GitHub9 小时前
我近期看到的最有创意的 GitHub 开源项目,太惊艳了。
github
m4Rk_10 小时前
【论文阅读】Agent 记忆机制(73):MemGAS——让长期对话记忆按问题选择粒度并关联证据
论文阅读·人工智能·学习·开源·github
横木沉13 小时前
IntelliJ IDEA 无法识别 Git:Git is not installed 问题解决
java·git·github·intellij-idea
小麦在野14 小时前
独立 App 开发系列:用 GitHub Pages 托管隐私政策和用户协议
android·github
用户68559861145514 小时前
我做了一套知识结构规格,它最核心的约束是拒绝替你填内容
github
简创AIGC陶先生14 小时前
【直播切片工作台】第14章:种子数据 Seeder
github