Skip to content

Commit

Permalink
👷 Feat: Add Vercel deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
RSelwa committed Dec 19, 2024
1 parent 3ac9e9e commit a6cc284
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: 🧪 Playwright Tests
name: 🧪

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

on:
push:
Expand Down Expand Up @@ -68,15 +72,38 @@ jobs:
cleanup:
name: 🫧 Clean build cache
runs-on: ubuntu-latest
needs: [playwright-test, unit-test]
if: success()
permissions:
contents: write
actions: write
needs: [playwright-test, unit-test]
if: success()
steps:
- uses: actions/checkout@v4

- name: 🫧 Clean build cache
run: gh cache delete ${{ github.sha }}-build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

vercel:
name: 🔼 Deploy to vercel
runs-on: ubuntu-latest
needs: [playwright-test, unit-test]
if: success()
steps:
- uses: actions/checkout@v4

- name: 🧶 Set up Node.js
uses: ./.github/actions/init-pnpm

- name: 🔼 Install Vercel CLI
run: pnpm install --global vercel@canary

- name: ⬇ Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --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 @@ -39,3 +39,5 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/

.vercel
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"cSpell.words": ["nextjs"]
"cSpell.words": ["nextjs", "vercel"]
}
6 changes: 6 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"buildCommand": "next build",
"git": {
"ignoredFiles": ["node_modules", ".next", "out"]
}
}

0 comments on commit a6cc284

Please sign in to comment.