-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (76 loc) · 2.64 KB
/
Copy pathdeploy.yml
File metadata and controls
92 lines (76 loc) · 2.64 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
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
# build ジョブと同じく main の最新 tip をテストする(下の build 参照)。
- uses: actions/checkout@v4
with:
ref: main
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test -- --run
- run: pnpm exec tsc --noEmit
build:
needs: test
runs-on: ubuntu-latest
environment: github-pages
steps:
# ref: main を明示し、ジョブ実行時の main 最新 tip を fetch し直す。
# tauri-build.yml は latest.json を main に push した「直後」に
# workflow_dispatch でこの deploy を叩くが、dispatch 解決時点では push が
# まだ反映されず、親コミット(更新前の public/updater/latest.json)の SHA で
# 走ってしまう競合がある。その結果 Pages の updater が前バージョンを指し続け、
# アプリが新バージョンに更新できなくなる(v0.16.2 で実害)。
- uses: actions/checkout@v4
with:
ref: main
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
# pnpm build が scripts/fetch-fonts.mjs 経由で日本語 Web フォント(約 8MB)を
# 取得する。CDN 側の一時的な失敗で Pages のデプロイが落ちないようキャッシュする。
# キー / restore-keys の方針は test.yml の同ステップのコメント参照。
- name: Cache Japanese webfonts
uses: actions/cache@v4
with:
path: public/fonts/jp
key: jp-fonts-${{ runner.os }}-${{ hashFiles('scripts/fetch-fonts.mjs') }}
- run: pnpm build
# ユーザーマニュアル(VitePress)を /Graphium/manual/ 配下として同梱する
- run: pnpm manual:build
- run: cp -R manual/.vitepress/dist dist/manual
- uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4