Repository navigation
82 lines (78 loc) · 2.61 KB
/
Copy pathdeploy.yml
File metadata and controls
82 lines (78 loc) · 2.61 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
name: deploy
on:
push:
branches: [main]
paths: ['web/**', 'data/**', 'scripts/**', 'collector/**', 'pipeline/shorts/**', '.github/workflows/deploy.yml']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: true
jobs:
sync-readme:
# README '숫자' 표를 data/*.json 실측으로 다시 쓴다(정의: scripts/sync-readme.mjs).
# 바뀌면 봇이 커밋한다. GITHUB_TOKEN 푸시는 deploy 를 다시 트리거하지 않아 무한루프가 없다.
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: main
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 20
- name: README 수치 동기화
run: node scripts/sync-readme.mjs
- name: 바뀐 게 있으면 커밋·푸시
run: |
set -eu
if git diff --quiet -- README.md; then
echo "변경 없음 — 커밋하지 않는다"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "chore(readme): sync numbers from data"
git pull --rebase --autostash origin main
git push origin HEAD:main
build:
permissions:
contents: read
pages: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 20
cache: npm
cache-dependency-path: web/package-lock.json
- name: Collector + shorts 테스트 (파서 fixture 회귀 포함)
run: |
python3 -m venv /tmp/tv
/tmp/tv/bin/pip install --quiet pillow
PATH=/tmp/tv/bin:$PATH npm test
- name: Install
run: npm ci
working-directory: web
- name: Build (slop-lint 게이트 포함)
run: npm run build
working-directory: web
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: web/dist
deploy:
permissions:
pages: write
id-token: write
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5