This commit is contained in:
Zuoling Rong
2025-02-02 23:00:06 +08:00
parent 00d3892bcd
commit 7996f29114
4 changed files with 85 additions and 48 deletions

View File

@@ -10,8 +10,6 @@ permissions:
contents: write
pages: write
id-token: write
issues: write
actions: write
# 允许一个并发部署
concurrency:
@@ -20,8 +18,6 @@ concurrency:
jobs:
build:
# 只在原仓库或fork的仓库中运行
if: github.repository == 'RZLNB/menav' || github.event.repository.fork == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -50,44 +46,6 @@ jobs:
with:
path: '.'
- name: Create deployment guide issue
# 只在fork的仓库中创建issue
if: github.event.repository.fork == true
uses: actions/github-script@v7
with:
script: |
const issueBody = `
# 部署指南
请按照以下步骤完成网站部署:
1. 首先确保正确配置权限:
- 进入仓库的 Settings -> Actions -> General
- 在 "Workflow permissions" 部分
- 选择 "Read and write permissions"
- 勾选 "Allow GitHub Actions to create and approve pull requests"
- 点击 Save
2. 然后配置 Pages:
- 进入仓库的 Settings -> Pages
- 在 "Build and deployment" 部分
- Source: 选择 "GitHub Actions"
- 点击 Save
完成以上步骤后,工作流将自动部署您的网站。
部署完成后,您可以在 Settings -> Pages 中找到您的网站地址。
如果遇到权限相关错误,请确保完成了步骤1的所有配置。
`;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: '🚀 如何部署您的导航站点',
body: issueBody,
labels: ['documentation']
});
deploy:
environment:
name: github-pages