feat: add incremental build caching and branch-specific Vercel deployment

- Add build artifact caching using branch name as cache key
- Cache .pages, storybook-static, and coverage directories
- Configure Vercel deployment with branch-specific alias domains
- Optimize build performance with cache restore fallbacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-10-16 01:10:44 +00:00
parent 8a1d38e9b7
commit a678f6cd2e

View File

@@ -36,6 +36,18 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
.pages
storybook-static
coverage
key: build-cache-${{ github.ref_name }}-${{ hashFiles('pnpm-lock.yaml', 'package.json') }}
restore-keys: |
build-cache-${{ github.ref_name }}-
build-cache-main-
- name: Download Storybook artifact (source run)
id: fetch_storybook_trigger
continue-on-error: true
@@ -96,7 +108,7 @@ jobs:
name: built-pages
path: '.pages'
incremental-deploy-github-pages:
deploy-github-pages:
permissions:
contents: read
pages: write
@@ -134,9 +146,11 @@ jobs:
- name: Deploy to Vercel
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} # Required
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: .pages
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Required for Vercel Action
vercel-args: '--prod'
github-comment: false
alias-domains: |
${{ github.ref_name }}-comfyui-frontend-docs.vercel.app