-
-
Notifications
You must be signed in to change notification settings - Fork 15
88 lines (75 loc) · 2.45 KB
/
docs.yml
File metadata and controls
88 lines (75 loc) · 2.45 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
name: Deploy Site
on:
push:
branches: [master]
paths:
- 'landing/**'
- 'docs/**'
- 'blog/**'
- '.github/workflows/docs.yml'
workflow_run:
workflows: ["Industry Map Build"]
types: [completed]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python (for HF seed)
run: uv python install 3.12
- name: Install Python deps
run: uv sync
# HF SSoT: map JSON 은 git 에 없음 (.gitignore). 빌드 전 HF 에서 내려받아
# landing/static/map/ 에 풀어둠 → SvelteKit static adapter 가 build/ 에 복사.
- name: Seed industry map from HF
run: uv run python -X utf8 .github/scripts/seedFromHf.py --category industryMap
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
DARTLAB_DATA_DIR: ${{ github.workspace }}
- name: Move HF seed to landing/static/map
run: |
set -euo pipefail
# seedFromHf 는 HF 의 dir (landing/map/) 을 $DARTLAB_DATA_DIR 아래에 그대로 복제.
# landing/map/ → landing/static/map/ 으로 이동 (SvelteKit static path).
if [ -d landing/map ]; then
mkdir -p landing/static/map
cp -r landing/map/. landing/static/map/
rm -rf landing/map
fi
count=$(find landing/static/map/companies -maxdepth 1 -name '*.json' 2>/dev/null | wc -l)
echo "map companies count: $count"
[ "$count" -ge 2000 ] || { echo "ERROR: map seed 부족 ($count)"; exit 1; }
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
- name: Build site
working-directory: landing
run: |
npm ci
BASE_PATH=/dartlab npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: landing/build/
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@v5