1.2.1
This commit is contained in:
31
.github/workflows/deploy.yml
vendored
31
.github/workflows/deploy.yml
vendored
@@ -11,6 +11,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -22,14 +24,37 @@ jobs:
|
|||||||
node-version: '16'
|
node-version: '16'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: |
|
||||||
|
npm install
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to install dependencies"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Generate site
|
- name: Generate site
|
||||||
run: node generator.js
|
run: |
|
||||||
|
node generator.js
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to generate site"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v4
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@v4
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
with:
|
with:
|
||||||
folder: .
|
folder: .
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
clean: true
|
clean: true
|
||||||
|
|
||||||
|
- name: Enable GitHub Pages
|
||||||
|
run: |
|
||||||
|
gh api \
|
||||||
|
--method PUT \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
/repos/${{ github.repository }}/pages \
|
||||||
|
-f source='{"branch":"gh-pages","path":"/"}'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
28
README.md
28
README.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
一个简洁美观的个人导航网站,帮助你整理和展示你的网络收藏。
|
一个简洁美观的个人导航网站,帮助你整理和展示你的网络收藏。
|
||||||
|
|
||||||
|
[](https://github.com/RZLNB/menav/actions/workflows/deploy.yml)
|
||||||
|
|
||||||
## 在线预览
|
## 在线预览
|
||||||
|
|
||||||
访问:[https://rzlnb.github.io/menav/](https://rzlnb.github.io/menav/)
|
访问:[https://rzlnb.github.io/menav/](https://rzlnb.github.io/menav/)
|
||||||
@@ -51,17 +53,25 @@ npm run generate
|
|||||||
|
|
||||||
## 部署方式
|
## 部署方式
|
||||||
|
|
||||||
### GitHub Pages 部署
|
### GitHub Pages 一键部署
|
||||||
|
|
||||||
注意:GitHub Pages 在免费计划下只支持公开仓库。如果你需要保持仓库私有,建议:
|
只需三步即可完成部署:
|
||||||
- 升级到 GitHub Pro 或更高级的付费计划
|
|
||||||
- 或使用 Cloudflare Pages 部署(支持私有仓库)
|
|
||||||
|
|
||||||
部署步骤:
|
1. 点击右上角的 Fork 按钮,复制这个仓库到你的账号
|
||||||
1. Fork 这个仓库
|
|
||||||
2. 修改你的配置
|
2. 修改配置文件
|
||||||
3. 推送到GitHub
|
- 打开 `config.yml` 文件
|
||||||
4. 启用GitHub Pages(选择 gh-pages 分支)
|
- 根据你的需求修改网站内容
|
||||||
|
- 提交更改
|
||||||
|
|
||||||
|
3. 等待自动部署
|
||||||
|
- 提交更改后,GitHub Actions 会自动开始构建和部署
|
||||||
|
- 部署完成后,你可以通过 `https://你的用户名.github.io/menav` 访问你的网站
|
||||||
|
- 部署状态可以在仓库的 Actions 标签页查看
|
||||||
|
|
||||||
|
注意:首次部署可能需要等待1-2分钟。如果遇到问题:
|
||||||
|
- 确保仓库设置中的 Actions 权限已启用
|
||||||
|
- 检查仓库的 Actions 标签页中的部署日志
|
||||||
|
|
||||||
### Cloudflare Pages 部署
|
### Cloudflare Pages 部署
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user