chore(deps): bump googleapis/release-please-action from 4 to 5 #5
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: Preview Deployment | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| branches: [main, develop] | |
| jobs: | |
| deploy-preview: | |
| name: Deploy Preview | |
| runs-on: ubuntu-latest | |
| if: github.event.action != 'closed' | |
| outputs: | |
| preview-url: ${{ steps.deploy.outputs.preview-url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install Vercel CLI | |
| run: npm install --global vercel@latest | |
| - name: Pull Vercel environment | |
| run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| - name: Build project | |
| run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| - name: Deploy to Vercel preview | |
| id: deploy | |
| run: | | |
| PREVIEW_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}) | |
| echo "preview-url=$PREVIEW_URL" >> $GITHUB_OUTPUT | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| - name: Post preview URL as PR comment | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const previewUrl = '${{ steps.deploy.outputs.preview-url }}'; | |
| const body = `## 🚀 Preview Deployment\n\n✅ Preview deployed successfully!\n\n🔗 **Preview URL:** ${previewUrl}\n\n_This preview will be cleaned up when the PR is closed._`; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.startsWith('## 🚀 Preview Deployment')); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } | |
| e2e-against-preview: | |
| name: E2E Tests Against Preview | |
| runs-on: ubuntu-latest | |
| needs: deploy-preview | |
| if: github.event.action != 'closed' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run E2E tests against preview | |
| run: npx playwright test --project=chromium | |
| env: | |
| BASE_URL: ${{ needs.deploy-preview.outputs.preview-url }} | |
| - name: Upload E2E results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: preview-e2e-results | |
| path: | | |
| test-results/ | |
| playwright-report/ | |
| cleanup-preview: | |
| name: Cleanup Preview | |
| runs-on: ubuntu-latest | |
| if: github.event.action == 'closed' | |
| steps: | |
| - name: Remove Vercel preview deployment | |
| run: | | |
| echo "PR closed — Vercel automatically cleans up preview deployments." | |
| echo "No manual cleanup required for Vercel preview environments." |