fix(deploy): provision archive queue and restore vite build step (#415)

v2.7 added the zpan-archive-jobs queue binding but the CF deploy workflow
never created it, and bd9f047 (#417) accidentally dropped the vite build
step. Add a queue-provisioning step (from @wshijiang) and restore an explicit
Build step so @cloudflare/vite-plugin generates the deploy config with the
correct assets directory.

Co-Authored-By: saltbo <rdsaltbo@gmail.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
wshijiang
2026-06-09 23:12:25 +08:00
committed by GitHub
parent ee8eea1a15
commit bae4d62d8a
+26
View File
@@ -137,6 +137,21 @@ jobs:
echo "url=https://$DOMAIN" >> "$GITHUB_OUTPUT"
echo "R2 public URL: https://$DOMAIN"
- name: Ensure Queue exists
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
OUTPUT=$(pnpm exec wrangler queues create zpan-archive-jobs 2>&1) || true
if echo "$OUTPUT" | grep -q "already taken"; then
echo "Queue already exists, skipping"
elif echo "$OUTPUT" | grep -q "ERROR"; then
echo "$OUTPUT"
exit 1
else
echo "Created queue: zpan-archive-jobs"
fi
- name: Patch wrangler.toml with D1 database ID
run: sed -i "s/database_id = \"[^\"]*\"/database_id = \"${{ steps.d1.outputs.id }}\"/" wrangler.toml
@@ -165,6 +180,17 @@ jobs:
echo "${{ steps.r2.outputs.url }}" | pnpm exec wrangler secret put PUBLIC_IMAGES_URL
echo "Set PUBLIC_IMAGES_URL = ${{ steps.r2.outputs.url }}"
# vite build runs the @cloudflare/vite-plugin, which writes the deploy
# config (dist/zpan/wrangler.json) that the subsequent wrangler deploy
# consumes: it resolves the assets directory to dist/client and inlines
# build-time defines. Must run after the D1 id patch so the generated
# config carries the real database_id. ZPAN_APP_VERSION sidesteps a git
# describe on the shallow tag checkout.
- name: Build
env:
ZPAN_APP_VERSION: ${{ steps.release.outputs.version }}
run: pnpm build
- name: Deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}