mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
[ci] Add retry logic to wrangler page deploy step (#5118)
- Implement 3-attempt retry mechanism for Cloudflare Pages deployment - Add 10-second delay between retry attempts - Install wrangler globally to ensure CLI availability - Maintain existing functionality while improving stability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
37
.github/workflows/test-ui.yaml
vendored
37
.github/workflows/test-ui.yaml
vendored
@@ -162,6 +162,9 @@ jobs:
|
|||||||
run: npx playwright install chromium --with-deps
|
run: npx playwright install chromium --with-deps
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
|
- name: Install Wrangler
|
||||||
|
run: npm install -g wrangler
|
||||||
|
|
||||||
- name: Run Playwright tests (${{ matrix.browser }})
|
- name: Run Playwright tests (${{ matrix.browser }})
|
||||||
id: playwright
|
id: playwright
|
||||||
run: npx playwright test --project=${{ matrix.browser }} --reporter=html
|
run: npx playwright test --project=${{ matrix.browser }} --reporter=html
|
||||||
@@ -177,11 +180,35 @@ jobs:
|
|||||||
- name: Deploy to Cloudflare Pages (${{ matrix.browser }})
|
- name: Deploy to Cloudflare Pages (${{ matrix.browser }})
|
||||||
id: cloudflare-deploy
|
id: cloudflare-deploy
|
||||||
if: always()
|
if: always()
|
||||||
uses: cloudflare/wrangler-action@v3
|
run: |
|
||||||
with:
|
# Retry logic for wrangler deploy (3 attempts)
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
RETRY_COUNT=0
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
MAX_RETRIES=3
|
||||||
command: pages deploy ComfyUI_frontend/playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }}
|
SUCCESS=false
|
||||||
|
|
||||||
|
while [ $RETRY_COUNT -lt $MAX_RETRIES ] && [ $SUCCESS = false ]; do
|
||||||
|
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||||
|
echo "Deployment attempt $RETRY_COUNT of $MAX_RETRIES..."
|
||||||
|
|
||||||
|
if npx wrangler pages deploy ComfyUI_frontend/playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }}; then
|
||||||
|
SUCCESS=true
|
||||||
|
echo "Deployment successful on attempt $RETRY_COUNT"
|
||||||
|
else
|
||||||
|
echo "Deployment failed on attempt $RETRY_COUNT"
|
||||||
|
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
|
||||||
|
echo "Retrying in 10 seconds..."
|
||||||
|
sleep 10
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $SUCCESS = false ]; then
|
||||||
|
echo "All deployment attempts failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
|
||||||
- name: Save deployment info for summary
|
- name: Save deployment info for summary
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user