-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (100 loc) · 3.28 KB
/
Copy pathdeploey.yml
File metadata and controls
122 lines (100 loc) · 3.28 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
#
name: Check and deploy VitePress site
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# 默认只授予读取代码的权限;部署 job 单独申请 Pages 权限。
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: false
jobs:
quality:
name: Quality checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Verify deploy-time share ID generation
run: pnpm share-links:prepare
- name: Check committed secrets
run: pnpm check:secrets
- name: Type-check VitePress config
run: pnpm typecheck
- name: Type-check Vue theme
run: pnpm typecheck:vue
- name: Run unit tests
run: pnpm test
build:
name: Build YuuFrag and short-link artifacts
if: github.event_name != 'pull_request'
needs: quality
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.CONTRIBUTOR_TOKEN || github.token }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build with VitePress
run: pnpm docs:build
- name: Verify both share-link artifacts
run: pnpm share-links:artifacts:check
- name: Upload standalone short-link archive
uses: actions/upload-artifact@v4
with:
name: yuufrag-shortlinks
path: .shortlink-dist
if-no-files-found: error
retention-days: 30
include-hidden-files: true
- name: Upload YuuFrag Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: .vitepress/dist
deploy:
if: github.event_name != 'pull_request'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5