Skip to content

Commit

Permalink
Changes in workflow to deploy if tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ad956 committed May 7, 2024
1 parent 869cd35 commit f5934f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Playwright Tests
name: Playwright Tests and Vercel Deployment

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
timeout-minutes: 60
Expand All @@ -25,3 +27,23 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30

deploy:
needs: test
if: ${{ success() }}
runs-on: ubuntu-latest

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

steps:
- uses: actions/checkout@v3
- name: Install Vercel CLI
run: npm install --global vercel@canary
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ todo.md
/playwright-report/
/blob-report/
/playwright/.cache/

.vercel

0 comments on commit f5934f6

Please sign in to comment.