Skip to content

Merge pull request #2 from py-dev-nandini-12/feature/enhanced-form #8

Merge pull request #2 from py-dev-nandini-12/feature/enhanced-form

Merge pull request #2 from py-dev-nandini-12/feature/enhanced-form #8

Workflow file for this run

name: Deploy and Run E2E Tests
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
name: Deploy to Vercel
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Vercel CLI
run: npm install -g vercel
- name: Deploy to Vercel
id: deploy
run: |
vercel pull --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN_MY_PROJECT }}
DEPLOY_URL=$(vercel deploy --staging --token ${{ secrets.VERCEL_TOKEN_MY_PROJECT }} | tail -1)
echo "DEPLOYMENT_URL=${DEPLOY_URL}" >> $GITHUB_ENV
echo "Deployed to: $DEPLOY_URL"
env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_MY_PROJECT }}
e2e:
name: Run E2E Tests
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Install Playwright
run: npx playwright install
- name: Run Playwright Tests
run: npx playwright test
env:
BASE_URL: ${{ env.DEPLOYMENT_URL }}