mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-23 00:20:40 +07:00
feat(resume): Phase 2 CI integration for PDF generation
- Split deploy.yml into 3 jobs: build, generate-resume, deploy - generate-resume job: Playwright cache, chromium install, PDF generation - deploy job: download both static-site and resume-pdf artifacts - Add build:resume convenience script in package.json - Artifact retention: site 5 days, PDF 30 days
This commit is contained in:
1 parent
d6ef0bd93f
commit
26af25a39d
2 files changed
+55
-6
No files matched your search
@@ -6,7 +6,7 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build and deploy:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
@@ -15,11 +15,59 @@ jobs:
|
|||||||
cache: true
|
cache: true
|
||||||
version: ^12.0.0
|
version: ^12.0.0
|
||||||
runtime: node@24
|
runtime: node@24
|
||||||
- run: node --version
|
|
||||||
- run: pnpm build
|
- run: pnpm build
|
||||||
- name: List files in dist
|
- uses: actions/upload-artifact@v4
|
||||||
run: |
|
with:
|
||||||
ls ${{ gitea.workspace }}/dist
|
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
|
||||||
|
- run: pnpm tsx scripts/generate-resume.ts
|
||||||
|
|
||||||
|
# Upload PDF artifact
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: resume-pdf
|
||||||
|
path: dist/resume.pdf
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build, generate-resume]
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: static-site
|
||||||
|
path: dist/
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: resume-pdf
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: rsync deployments
|
- name: rsync deployments
|
||||||
uses: burnett01/rsync-deployments@v9
|
uses: burnett01/rsync-deployments@v9
|
||||||
with:
|
with:
|
||||||
@@ -30,4 +78,4 @@ jobs:
|
|||||||
remote_host: ${{ secrets.DEPLOY_HOST }}
|
remote_host: ${{ secrets.DEPLOY_HOST }}
|
||||||
remote_port: ${{ secrets.DEPLOY_SSH_PORT }}
|
remote_port: ${{ secrets.DEPLOY_SSH_PORT }}
|
||||||
remote_user: ${{ secrets.DEPLOY_USER }}
|
remote_user: ${{ secrets.DEPLOY_USER }}
|
||||||
remote_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
remote_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
|
"build:resume": "pnpm tsx scripts/generate-resume.ts",
|
||||||
"lint": "oxlint",
|
"lint": "oxlint",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user