项目部署
点击下面的按钮部署到 Vercel:

首次部署会因为没有数据库报错, 不要管直接进行接下来的步骤申请 Vercel 数据库
进入Vercel Storage 界面 然后点击右上角的 Create Database 并选择 Neon 创建免费数据库,数据库地址默认即可(通常为Washington, D.C., USA (East))
在 Database Name (*)取一个随意的名字然后点击 create
创建完成之后进入数据库,点击 Connect Project,在最上方选择刚刚fork的项目,选择完直接点击connect,这样数据库就连接成功了
重新部署vercel项目
点击你fork的项目,点击左上角的 Deployments,再点击下方内容的右边三个点,点击Redeploy重新部署,重新部署完之后给项目绑定一个自定义域名,这样就完成了
创建github仓库
创建一个github私有仓库(如果不建议博客在大街上飘那请随意)
创建完之后点击上方绿色按钮,复制ssh密钥➡️在你本地磁盘找一个地方右键,点击git bash here➡️输入 git clone 你的密钥下载到本地更改
将博客源代码都复制进去,然后依次执行
1 2 3
| git add . git commit -m "第一次提交" git push
|
这样就上传到GitHub仓库了
后台配置
进入你刚刚给后台设置的域名,添加用户名和密码
- 添加github密钥
Github 设置 生成的 Token (建议使用 Classical) 需要 Repo & Workflow 下的权限 不建议给出所有权限,剩下的自己填填

注意,项目分支根据实际情况填写,main或者master
添加vercel密钥
您的 Vercel 账户密钥 在 此处 生成
PROJECT_ID:您 Qexo 部署所在项目的 ID 位于 Project Settings -> General -> Project ID
登录后台
输入账号密码就能用了,其他功能自行研究
QEXO文档
配置GitHub Actions
此功能可以实现监测所有 source 目录下的文件变动,所有 yml,json 后缀文件的变动。然后进行自动推送
在本地创建 .github/workflows/main.yml,添加以下代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| name: Blog自动推送
on: push: branches: [main, master] paths: - '*.json' - '**.yml' - '**/source/**'
jobs: blog: timeout-minutes: 30 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Cache node_modules uses: actions/cache@v4 env: cache-name: cache-node-modules with: path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - name: Init Node.js run: | npm install echo "init node successful" - name: Install Hexo-cli And component run: | npm install -g hexo-cli --save npm install hexo-generator-sitemap --save npm install hexo-generator-baidu-sitemap --save npm install hexo-abbrlink --save npm install hexo-renderer-pug hexo-renderer-stylus --save npm i hexo-renderer-markdown-it --save npm install hexo-generator-searchdb npm install katex @renbaoshuo/markdown-it-katex npm install hexo-wordcount --save npm i hexo-filter-nofollow --save npm install hexo-generator-feed --save echo "install hexo successful" - name: Build Blog run: | hexo clean && hexo g echo "build blog successful" - name: Deploy Blog run: | cd ./public git init git config user.name "${{secrets.GIT_NAME}}" git config user.email "${{secrets.GIT_EMAIL}}" git add . git commit -m "Update" git push --force --quiet "https://${{secrets.GH_TOKEN}}@${{secrets.GH_REF}}" master:main
- run: echo "Deploy Successful!"
|
然后进行推送更新
1 2 3
| git add . git commit -m "第一次提交" git push
|
配置存储库 Secrets
上方Github Action的配置文件 Deploy Blog中引用了4个 Secret,分别是 GIT_NAME, GIT_EMAIL, GH_TOKEN, GH_REF, 接下来将在存储库中设置它们
- 在 Github -> 源码仓库 -> Settings -> Secrets and variables -> Actions -> Secrets 中添加用于Github Action的Secrets

Secrets的名称分别是上方 GIT_NAME, GIT_EMAIL, GH_TOKEN, GH_REF
其中 GH_TOKEN上面配置qexo的时候已经获取,可以直接使用
GH_REF的内容为 github.com/用户名/Blog仓库名.git(这里的仓库是你博客静态文件的仓库,不是源码仓库)
结尾
接下来你直接在qexo添加一篇文章并上传就可以看见了,可以实现云端写博客,云端添加友链
- 如下
