Skip to content

Commit 0fe1351

Browse files
added few modifications
1 parent 3b02df4 commit 0fe1351

File tree

2 files changed

+73
-21
lines changed

2 files changed

+73
-21
lines changed

.github/workflow/deploy-e2e.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy and Run E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
name: Deploy to Vercel
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v3
17+
18+
- name: Install Vercel CLI
19+
run: npm install -g vercel
20+
21+
- name: Deploy to Vercel
22+
id: deploy
23+
run: |
24+
vercel pull --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN_MY_PROJECT }}
25+
DEPLOY_URL=$(vercel deploy --prod --token ${{ secrets.VERCEL_TOKEN_MY_PROJECT }} | tail -1)
26+
echo "DEPLOYMENT_URL=${DEPLOY_URL}" >> $GITHUB_ENV
27+
echo "Deployed to: $DEPLOY_URL"
28+
29+
env:
30+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
31+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
32+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_MY_PROJECT }}
33+
34+
e2e:
35+
name: Run E2E Tests
36+
runs-on: ubuntu-latest
37+
needs: deploy
38+
39+
steps:
40+
- name: Checkout Code
41+
uses: actions/checkout@v3
42+
43+
- name: Install Dependencies
44+
run: npm install
45+
46+
- name: Install Playwright
47+
run: npx playwright install
48+
49+
- name: Run Playwright Tests
50+
run: npx playwright test
51+
env:
52+
BASE_URL: ${{ env.DEPLOYMENT_URL }}

.github/workflow/deploy.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
name: Deploy to Vercel
1+
# name: Deploy to Vercel
22

3-
on:
4-
push:
5-
branches:
6-
- main # Change this if you're using a different branch
3+
# on:
4+
# push:
5+
# branches:
6+
# - main # Change this if you're using a different branch
77

8-
jobs:
9-
deploy:
10-
runs-on: ubuntu-latest
8+
# jobs:
9+
# deploy:
10+
# runs-on: ubuntu-latest
1111

12-
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
12+
# steps:
13+
# - name: Checkout repository
14+
# uses: actions/checkout@v4
1515

16-
- name: Install Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: 18
16+
# - name: Install Node.js
17+
# uses: actions/setup-node@v4
18+
# with:
19+
# node-version: 18
2020

21-
- name: Install dependencies
22-
run: pnpm install
21+
# - name: Install dependencies
22+
# run: pnpm install
2323

24-
- name: Build Next.js app
25-
run: pnpm run build
24+
# - name: Build Next.js app
25+
# run: pnpm run build
2626

27-
- name: Deploy to Vercel
28-
run: npx vercel --token=${{ secrets.VERCEL_TOKEN_MY_PROJECT }} --prod
27+
# - name: Deploy to Vercel
28+
# run: npx vercel --token=${{ secrets.VERCEL_TOKEN_MY_PROJECT }} --prod

0 commit comments

Comments
 (0)