-
Notifications
You must be signed in to change notification settings - Fork 6
108 lines (84 loc) · 2.15 KB
/
ci.yml
File metadata and controls
108 lines (84 loc) · 2.15 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
# MetaHuman Engine - CI & Deploy
# 极简工作流:质量检查 + 构建 + 部署 + 发布
name: CI & Deploy
on:
push:
branches: [master, main]
tags: ['v*']
pull_request:
branches: [master, main]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: '22'
jobs:
# ========== 质量检查 ==========
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci --prefer-offline
- name: Type check
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Test
run: npm run test:run
env:
CI: true
- name: Build
run: npm run build
env:
NODE_ENV: production
# ========== 部署 Pages ==========
deploy:
name: Deploy Pages
runs-on: ubuntu-latest
needs: ci
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
environment:
name: github-pages
url: https://lessup.github.io/meta-human/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci --prefer-offline
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build for Pages
run: npm run build:pages
env:
NODE_ENV: production
- uses: actions/upload-pages-artifact@v3
with:
path: ./dist
- uses: actions/deploy-pages@v4
# ========== 发布 Release ==========
release:
name: Create Release
runs-on: ubuntu-latest
needs: ci
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
with:
name: MetaHuman Engine ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false