Skip to content

Commit d76cfce

Browse files
committed
feat(site): Astro intro homepage + static OpenAPI docs + GitHub Pages deploy
Astro site (homepage + Scalar API reference from a static openapi.json) deployed to GitHub Pages alongside the static JSON dump, so the dataset is served as a static API even while it is still partial.
1 parent b970088 commit d76cfce

8 files changed

Lines changed: 5708 additions & 0 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: deploy-pages
2+
3+
# Builds the Astro site (intro homepage + OpenAPI docs) together with the static
4+
# JSON data dump and deploys everything to GitHub Pages. The dataset does not need
5+
# to be complete — whatever is curated in data/ is published.
6+
# Enable once: Settings → Pages → Source = GitHub Actions.
7+
on:
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.12"
30+
cache: pip
31+
32+
- name: Install Python deps
33+
run: pip install -e .
34+
35+
- name: Validate curated data
36+
run: python -m scripts.validate
37+
38+
- name: Generate static JSON dump + openapi.json
39+
run: python -m scripts.dump --output dump
40+
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: "22"
44+
cache: npm
45+
cache-dependency-path: site/package-lock.json
46+
47+
- name: Build Astro site
48+
run: |
49+
cd site
50+
npm ci
51+
npm run build
52+
53+
- name: Assemble site (Astro dist + JSON data dump)
54+
run: |
55+
mkdir -p _site
56+
cp -r site/dist/. _site/
57+
cp -r dump/. _site/
58+
touch _site/.nojekyll
59+
60+
- uses: actions/upload-pages-artifact@v3
61+
with:
62+
path: _site
63+
64+
deploy:
65+
needs: build
66+
runs-on: ubuntu-latest
67+
environment:
68+
name: github-pages
69+
url: ${{ steps.deployment.outputs.page_url }}
70+
steps:
71+
- id: deployment
72+
uses: actions/deploy-pages@v4

site/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Astro / Node build artifacts
2+
node_modules/
3+
dist/
4+
.astro/

site/astro.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'astro/config';
2+
3+
// GitHub Pages project site. Data dump (v1/, openapi.json) is copied alongside
4+
// the built site in CI, so internal links use import.meta.env.BASE_URL.
5+
export default defineConfig({
6+
site: 'https://seungpyo1007.github.io',
7+
base: '/TechAPI',
8+
});

0 commit comments

Comments
 (0)