Repository navigation
70 lines (61 loc) · 1.79 KB
/
Copy pathdeploy.yml
File metadata and controls
70 lines (61 loc) · 1.79 KB
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
62
63
64
65
66
67
68
69
70
# deploy.yml — push custom 自动部署到 GitHub Pages。
#
# 构建在 GitHub Actions 完成,产物发布到 GitHub Pages。
# 日常 push 到 custom(含发文)会自动构建并上线;也可手动 Run workflow。
#
# 一次性仓库设置(仅需一次):
# Settings → Pages → Build and deployment → Source = GitHub Actions
#
# 站点地址(项目站):https://Marvel-L.github.io/Blog/
# 若改用用户主页仓或自定义域名,请同步改下面的 VITE_SITE_URL / VITE_BASE_PATH。
name: Deploy to GitHub Pages
on:
push:
branches: [custom]
workflow_dispatch:
concurrency:
group: deploy-github-pages
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
discussions: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out repository
uses: actions/checkout@v5
with:
# 全量历史:gen:data 用 Git 首次/末次提交日填充文章 date/updatedAt。
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
env:
VITE_SITE_URL: https://Marvel-L.github.io/Blog
VITE_BASE_PATH: /Blog/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4