1.2.3
This commit is contained in:
59
.github/workflows/deploy.yml
vendored
59
.github/workflows/deploy.yml
vendored
@@ -7,52 +7,46 @@ on:
|
|||||||
# 添加fork后的首次运行触发
|
# 添加fork后的首次运行触发
|
||||||
fork:
|
fork:
|
||||||
|
|
||||||
jobs:
|
# 设置GITHUB_TOKEN的权限
|
||||||
build-and-deploy:
|
permissions:
|
||||||
runs-on: ubuntu-latest
|
contents: read
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pages: write
|
pages: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
|
# 允许一个并发部署
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Check GitHub Pages status
|
|
||||||
id: pages-status
|
|
||||||
run: |
|
|
||||||
if [ "$(gh api repos/${{ github.repository }}/pages --jq .status)" != "null" ]; then
|
|
||||||
echo "GitHub Pages is already enabled"
|
|
||||||
echo "pages_enabled=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "GitHub Pages needs to be enabled manually"
|
|
||||||
echo "pages_enabled=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm ci
|
||||||
|
|
||||||
- name: Generate site
|
- name: Generate site
|
||||||
run: node generator.js
|
run: npm run generate
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Setup Pages
|
||||||
if: steps.pages-status.outputs.pages_enabled == 'true'
|
uses: actions/configure-pages@v3
|
||||||
uses: JamesIves/github-pages-deploy-action@v4
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v2
|
||||||
with:
|
with:
|
||||||
folder: .
|
path: '.'
|
||||||
branch: gh-pages
|
|
||||||
clean: true
|
|
||||||
|
|
||||||
- name: Create deployment guide issue
|
- name: Create deployment guide issue
|
||||||
if: steps.pages-status.outputs.pages_enabled == 'false'
|
if: github.event_name == 'fork'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -77,3 +71,14 @@ jobs:
|
|||||||
body: issueBody,
|
body: issueBody,
|
||||||
labels: ['documentation']
|
labels: ['documentation']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v2
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -3,11 +3,6 @@ node_modules/
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# 构建产物
|
|
||||||
public/
|
|
||||||
index.html
|
|
||||||
|
|
||||||
# IDE 配置
|
# IDE 配置
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|||||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -50,3 +50,17 @@
|
|||||||
- 项目初始化
|
- 项目初始化
|
||||||
- 基础文件结构
|
- 基础文件结构
|
||||||
- 开发环境配置
|
- 开发环境配置
|
||||||
|
|
||||||
|
## [1.2.3] - 2024-03-21
|
||||||
|
|
||||||
|
### 优化
|
||||||
|
- 改进GitHub Pages部署流程
|
||||||
|
- 使用官方推荐的部署方式
|
||||||
|
- 添加自动化部署配置
|
||||||
|
- 优化构建缓存
|
||||||
|
- 更新依赖管理
|
||||||
|
- 添加开发服务器支持
|
||||||
|
- 优化依赖版本控制
|
||||||
|
- 改进项目配置
|
||||||
|
- 优化.gitignore规则
|
||||||
|
- 添加homepage配置
|
||||||
10
package.json
10
package.json
@@ -1,10 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "menav",
|
"name": "menav",
|
||||||
"version": "1.0.0",
|
"version": "1.2.3",
|
||||||
"description": "A personal navigation website",
|
"description": "A personal navigation website",
|
||||||
"main": "generator.js",
|
"main": "generator.js",
|
||||||
|
"homepage": "https://RZLNB.github.io/menav",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"generate": "node generator.js"
|
"generate": "node generator.js",
|
||||||
|
"dev": "node generator.js && serve .",
|
||||||
|
"clean": "rm -rf index.html"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"navigation",
|
"navigation",
|
||||||
@@ -15,5 +18,8 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"js-yaml": "^4.1.0"
|
"js-yaml": "^4.1.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"serve": "^14.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user