Repository navigation
83 lines (69 loc) · 2.98 KB
/
Copy pathdeploy.yml
File metadata and controls
83 lines (69 loc) · 2.98 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
# devxian96.github.io 배포
#
# GitHub Pages는 정적 파일만 서빙하므로 next.config.ts가 `output: 'export'`로
# out/ 디렉토리를 통째로 뽑아낸다. buzzle-landing처럼 서버에 이미지를 보내는
# 단계가 없고, 빌드 산출물을 Pages 아티팩트로 올리는 것으로 끝난다.
#
# 게이트는 buzzle 규칙 그대로다 — lint → type-check → build 순으로 돌고,
# 하나라도 실패하면 배포하지 않는다.
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# 배포가 겹치면 나중 것이 먼저 끝나 예전 빌드가 최종본이 될 수 있다.
# cancel-in-progress: false — 진행 중인 배포는 끝까지 마치게 둔다.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
# pnpm/action-setup 대신 Node에 내장된 corepack을 쓴다.
# package.json의 packageManager 필드가 버전을 고정하므로 결과는 동일하고,
# 잡이 내려받는 액션이 하나 줄어 GitHub 장애·스로틀링(429)에 걸릴 확률이 낮아진다.
#
# setup-node의 `cache: pnpm`은 쓰지 않는다 — 캐시 탐색이 pnpm을 먼저 요구해서
# corepack보다 앞서 실행되어야 하는데, 그러면 Node 교체 시 shim이 어긋난다.
# 설치가 20초쯤 길어지지만 배포가 액션 다운로드에 걸려 멈추는 편이 더 비싸다.
- name: Setup pnpm
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Type check
run: pnpm type-check
# actions/configure-pages는 쓰지 않는다.
# 이 워크플로는 그 액션의 출력(base_path, origin)을 하나도 참조하지 않고,
# Pages는 저장소에서 이미 활성화되어 있어 초기화 호출도 필요 없다.
# 잡이 내려받는 액션이 하나 줄면 GitHub 쪽 장애·스로틀링(429/503)에
# 배포가 걸릴 확률도 그만큼 줄어든다.
- name: Build
run: pnpm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4