From b60b8d8e61c35c43fc54d3e414c10866b3fee137 Mon Sep 17 00:00:00 2001 From: ClovertaTheTrilobita Date: Tue, 2 Jun 2026 01:10:24 +0800 Subject: [PATCH] update github cd --- .github/workflows/deploy-blog.yml | 64 ++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-blog.yml b/.github/workflows/deploy-blog.yml index c295982..eb4c030 100644 --- a/.github/workflows/deploy-blog.yml +++ b/.github/workflows/deploy-blog.yml @@ -71,8 +71,35 @@ jobs: - name: Install dependencies run: npm ci - - name: Install Playwright browsers - run: npx playwright install chromium --with-deps + - name: Install Playwright system dependencies + run: npx playwright install-deps chromium + timeout-minutes: 10 + + - name: Install Playwright Chromium headless shell + run: | + for attempt in 1 2 3; do + echo "Installing Playwright Chromium headless shell: attempt ${attempt}/3" + + if timeout 8m npx playwright install chromium --only-shell; then + echo "Playwright browser installed successfully." + exit 0 + fi + + echo "Playwright browser installation failed or hung." + echo "Removing incomplete browser cache before retrying..." + rm -rf ~/.cache/ms-playwright + + sleep 10 + done + + echo "Playwright browser installation failed after 3 attempts." + exit 1 + timeout-minutes: 30 + env: + PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT: "120000" + + - name: List installed Playwright browsers + run: npx playwright install --list - name: Create .env file run: | @@ -120,7 +147,7 @@ jobs: steps: - name: Checkout blog-content branch - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: blog-content @@ -133,8 +160,35 @@ jobs: - name: Install dependencies run: npm ci - - name: Install Playwright browsers - run: npx playwright install chromium --with-deps + - name: Install Playwright system dependencies + run: npx playwright install-deps chromium + timeout-minutes: 10 + + - name: Install Playwright Chromium headless shell + run: | + for attempt in 1 2 3; do + echo "Installing Playwright Chromium headless shell: attempt ${attempt}/3" + + if timeout 8m npx playwright install chromium --only-shell; then + echo "Playwright browser installed successfully." + exit 0 + fi + + echo "Playwright browser installation failed or hung." + echo "Removing incomplete browser cache before retrying..." + rm -rf ~/.cache/ms-playwright + + sleep 10 + done + + echo "Playwright browser installation failed after 3 attempts." + exit 1 + timeout-minutes: 30 + env: + PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT: "120000" + + - name: List installed Playwright browsers + run: npx playwright install --list - name: Create .env file run: |