mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
Phase 1 of spec-v4-live-edit: data/i18n foundation, no visible feature.
- src/data/{profile,skills,experience,projects}.json: language-neutral
structure documents with thin typed loaders; all prose moved to
src/i18n/locales/{vi,en}/content.json; chrome strings to ui.json
- src/i18n/: dict-types, cross-document validator (runs at module load and
via pnpm validate:content), loader joining structure+text once (UI/CONTENT),
I18nProvider/useI18n mounted in App under LanguageProvider
- all 22 consumers read joined records via useI18n(); field.ts and
strings.ts deleted; *En field pairs removed from the domain types
- hero tagline renders as plain-text segments (D9); philosophy quotes as
paragraph arrays; footer display name now localizes per language (D6)
- resume generator consumes UI/CONTENT; generated resume HTML verified
byte-identical (EN+VI) before/after the migration
- AGENTS.md and v3/v3-i18n + v4 specs updated; deploy.yml concurrency group
103 lines
2.5 KiB
YAML
103 lines
2.5 KiB
YAML
name: Deploy Static Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
|
|
concurrency:
|
|
group: deploy
|
|
cancel-in-progress: false
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: pnpm/setup@v3
|
|
with:
|
|
cache: true
|
|
version: ^12.0.0
|
|
runtime: node@24
|
|
- run: pnpm tsx scripts/validate-content.ts
|
|
- run: pnpm build
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: static-site
|
|
path: dist/
|
|
retention-days: 5
|
|
|
|
generate-resume:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: pnpm/setup@v3
|
|
with:
|
|
cache: true
|
|
version: ^12.0.0
|
|
runtime: node@24
|
|
|
|
# Cache Playwright browser — download once, reuse
|
|
- name: Cache Playwright browser
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
playwright-${{ runner.os }}-
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx playwright install chromium
|
|
- run: npx playwright install-deps chromium
|
|
|
|
# Generate English version (default)
|
|
- run: pnpm tsx scripts/generate-resume.ts --lang=en
|
|
|
|
# Generate Vietnamese version
|
|
- run: pnpm tsx scripts/generate-resume.ts --lang=vi
|
|
|
|
# Upload both PDF artifacts
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: resume-pdf-en
|
|
path: dist/resume.pdf
|
|
retention-days: 1
|
|
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: resume-pdf-vi
|
|
path: dist/resume-vi.pdf
|
|
retention-days: 1
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: [build, generate-resume]
|
|
steps:
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
name: static-site
|
|
path: dist/
|
|
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
name: resume-pdf-en
|
|
path: dist/
|
|
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
name: resume-pdf-vi
|
|
path: dist/
|
|
|
|
- name: rsync deployments
|
|
uses: burnett01/rsync-deployments@v9
|
|
with:
|
|
debug: true
|
|
switches: -avzr --delete
|
|
path: dist/
|
|
remote_path: /opt/stacks/dong-site/dist/
|
|
remote_host: ${{ secrets.DEPLOY_HOST }}
|
|
remote_port: ${{ secrets.DEPLOY_SSH_PORT }}
|
|
remote_user: ${{ secrets.DEPLOY_USER }}
|
|
remote_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|