Bump netlify-cli from 22.1.3 to 23.8.1 #32
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests with Playwright | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Wait for Netlify Deploy Preview | |
| run: | | |
| PR_NUMBER=${{ github.event.pull_request.number }} | |
| NETLIFY_URL="https://deploy-preview-${PR_NUMBER}--mattobee.netlify.app/" | |
| echo "Waiting for Netlify deployment at $NETLIFY_URL" | |
| retries=30 | |
| count=0 | |
| echo "Initial wait for Netlify build to start (60 seconds)..." | |
| sleep 60 | |
| until curl -s -o /dev/null -w "%{http_code}" "$NETLIFY_URL" | grep -q "200"; do | |
| ((count++)) | |
| if [ ${count} -ge ${retries} ]; then | |
| echo "Max retries reached (${retries} attempts). Failing the job." | |
| exit 1 | |
| fi | |
| echo "Attempt ${count}/${retries}: Netlify site not ready, retrying in 30 seconds..." | |
| sleep 30 | |
| done | |
| echo "✅ Netlify deployment is ready!" | |
| echo "NETLIFY_URL=$NETLIFY_URL" >> $GITHUB_ENV | |
| - name: Run Playwright tests against Netlify deploy | |
| env: | |
| BASE_URL: ${{ env.NETLIFY_URL }} | |
| run: | | |
| echo "Running tests against: $BASE_URL" | |
| npx playwright test |