This commit is contained in:
Zuoling Rong
2025-02-02 19:59:57 +08:00
parent f0b6aadb86
commit 15b2b9a216
2 changed files with 30 additions and 13 deletions

View File

@@ -6,11 +6,22 @@ on:
- main - main
workflow_dispatch: workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
# 允许一个并发部署
concurrency:
group: "pages"
cancel-in-progress: true
jobs: jobs:
build-and-deploy: build-and-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -27,9 +38,14 @@ jobs:
- name: Generate site - name: Generate site
run: node generator.js run: node generator.js
- name: Deploy to GitHub Pages - name: Setup Pages
uses: JamesIves/github-pages-deploy-action@v4 uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with: with:
folder: . path: '.'
branch: gh-pages
clean: true - name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View File

@@ -53,15 +53,16 @@ npm run generate
### GitHub Pages 部署 ### GitHub Pages 部署
注意GitHub Pages 在免费计划下只支持公开仓库。如果你需要保持仓库私有,建议 注意GitHub Pages 在免费计划下只支持公开仓库。如果你需要保持仓库私有,建议使用 Cloudflare Pages 部署(支持私有仓库)。
- 升级到 GitHub Pro 或更高级的付费计划
- 或使用 Cloudflare Pages 部署(支持私有仓库)
部署步骤: 部署步骤:
1. Fork 这个仓库 1. Fork 这个仓库
2. 修改你的配置 2. 修改 `config.yml` 文件,自定义你的导航内容
3. 推送到GitHub 3. 提交更改
4. 启用GitHub Pages选择 gh-pages 分支 4. 等待 GitHub Actions 自动完成部署约1-2分钟
5. 访问你的站点:`https://你的用户名.github.io/menav/`
全程自动化部署,无需任何手动设置。
### Cloudflare Pages 部署 ### Cloudflare Pages 部署