Skip to content

Commit 64077a2

Browse files
committed
Update portfolio content
1 parent 88aded8 commit 64077a2

File tree

5 files changed

+159
-22
lines changed

5 files changed

+159
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy to Vercel
22

33
on:
44
push:
55
branches:
66
- main # Set this to your default branch
77

88
jobs:
9-
build-and-deploy:
9+
deploy-to-vercel:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout 🛎️
@@ -20,12 +20,11 @@ jobs:
2020
- name: Install Dependencies
2121
run: npm ci
2222

23-
- name: Build
24-
run: npm run build
25-
26-
- name: Deploy to GitHub Pages 🚀
27-
uses: JamesIves/github-pages-deploy-action@v4
23+
- name: Deploy to Vercel 🚀
24+
uses: amondnet/vercel-action@v25
2825
with:
29-
folder: out
30-
branch: gh-pages
31-
clean: true
26+
vercel-token: ${{ secrets.VERCEL_TOKEN }} # You'll need to add this secret in your repo
27+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # You'll need to add this secret in your repo
28+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} # You'll need to add this secret in your repo
29+
working-directory: ./
30+
vercel-args: '--prod' # Deploy to production

deploy.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,24 @@ deploy_to_vercel() {
127127
echo "========================================="
128128
echo " Portfolio Website Deployment "
129129
echo "========================================="
130-
echo "1. Deploy to GitHub Pages"
131-
echo "2. Deploy to Vercel"
130+
echo "1. Deploy to Vercel (recommended)"
131+
echo "2. Deploy to GitHub Pages (legacy)"
132132
echo "3. Exit"
133133
echo "========================================="
134134
read -p "Choose an option (1-3): " choice
135135

136136
case $choice in
137137
1)
138-
deploy_to_github_pages
138+
deploy_to_vercel
139139
;;
140140
2)
141-
deploy_to_vercel
141+
print_warning "Note: The site is configured for Vercel deployment."
142+
read -p "Are you sure you want to deploy to GitHub Pages? (y/n): " confirm
143+
if [[ $confirm == [Yy]* ]]; then
144+
deploy_to_github_pages
145+
else
146+
print_warning "Deployment canceled."
147+
fi
142148
;;
143149
3)
144150
print_warning "Exiting deployment script."

next.config.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
output: 'export', // Enable static HTML export for GitHub Pages
5-
trailingSlash: true, // Add trailing slash to URLs
6-
images: {
7-
unoptimized: true, // For static export
8-
},
9-
basePath: process.env.NODE_ENV === 'production' ? '/portfolio-website' : '',
10-
// Optional: Set a custom asset prefix if needed
11-
// assetPrefix: process.env.NODE_ENV === 'production' ? 'https://mayur5204.github.io/portfolio-website' : '',
4+
// Vercel will automatically handle deployment configuration
5+
// No special settings needed for Vercel deployment with Next.js
126
};
137

148
export default nextConfig;

vercel-deploy.sh

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/bin/bash
2+
# Script to update and deploy the portfolio website to Vercel
3+
4+
# Set variables
5+
GITHUB_USERNAME="mayur5204"
6+
REPO_NAME="portfolio-website"
7+
8+
# Colors for output
9+
GREEN='\033[0;32m'
10+
YELLOW='\033[1;33m'
11+
RED='\033[0;31m'
12+
NC='\033[0m' # No Color
13+
14+
# Print colored output
15+
print_success() {
16+
echo -e "${GREEN}$1${NC}"
17+
}
18+
19+
print_warning() {
20+
echo -e "${YELLOW}$1${NC}"
21+
}
22+
23+
print_error() {
24+
echo -e "${RED}$1${NC}"
25+
}
26+
27+
# Check if Git is installed
28+
if ! [ -x "$(command -v git)" ]; then
29+
print_error "Error: git is not installed."
30+
exit 1
31+
fi
32+
33+
# Check if npm is installed
34+
if ! [ -x "$(command -v npm)" ]; then
35+
print_error "Error: npm is not installed."
36+
exit 1
37+
fi
38+
39+
# Main update function
40+
update_and_deploy() {
41+
print_warning "Updating from GitHub..."
42+
43+
# Check if we're in a git repository
44+
if [ ! -d ".git" ]; then
45+
print_error "This is not a git repository. Please run this script from the repository root."
46+
exit 1
47+
fi
48+
49+
# Save any uncommitted changes
50+
if [[ -n $(git status -s) ]]; then
51+
print_warning "Uncommitted changes detected. Stashing changes..."
52+
git stash
53+
fi
54+
55+
# Make sure we're on the main branch
56+
print_warning "Switching to main branch..."
57+
git checkout main
58+
59+
if [ $? -ne 0 ]; then
60+
print_error "Failed to switch to main branch. Please check your repository."
61+
exit 1
62+
fi
63+
64+
# Pull the latest changes
65+
print_warning "Pulling latest changes from GitHub..."
66+
git pull origin main
67+
68+
if [ $? -ne 0 ]; then
69+
print_error "Failed to pull from GitHub. Please check your internet connection and GitHub access."
70+
exit 1
71+
fi
72+
73+
# Install any new dependencies
74+
print_warning "Installing dependencies..."
75+
npm install
76+
77+
if [ $? -ne 0 ]; then
78+
print_error "Failed to install dependencies. Please check npm and try again."
79+
exit 1
80+
fi
81+
82+
print_success "Update completed successfully!"
83+
84+
# Ask if user wants to deploy
85+
read -p "Do you want to deploy to Vercel now? (y/n): " deploy_choice
86+
87+
if [[ $deploy_choice == [Yy]* ]]; then
88+
# Install Vercel CLI locally if not in node_modules
89+
if [ ! -d "node_modules/vercel" ]; then
90+
print_warning "Vercel CLI not found in local dependencies. Installing locally..."
91+
npm install --save-dev vercel
92+
93+
if [ $? -ne 0 ]; then
94+
print_error "Failed to install Vercel CLI. Please check npm permissions and try again."
95+
exit 1
96+
fi
97+
fi
98+
99+
# Check if user is logged in to Vercel, if not prompt to login
100+
print_warning "Checking Vercel authentication..."
101+
npx vercel whoami &>/dev/null
102+
103+
if [ $? -ne 0 ]; then
104+
print_warning "You are not logged in to Vercel. Please log in now:"
105+
npx vercel login
106+
107+
if [ $? -ne 0 ]; then
108+
print_error "Failed to log in to Vercel. Please try again."
109+
exit 1
110+
fi
111+
fi
112+
113+
# Deploy to Vercel (production) using local installation
114+
print_warning "Deploying to Vercel..."
115+
npx vercel --prod
116+
117+
if [ $? -eq 0 ]; then
118+
print_success "Deployed successfully to Vercel!"
119+
else
120+
print_error "Deployment to Vercel failed. Please check the error messages above."
121+
exit 1
122+
fi
123+
else
124+
print_warning "Deployment skipped. You can run './deploy.sh' later to deploy."
125+
fi
126+
}
127+
128+
# Execute the update function
129+
update_and_deploy

vercel.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 2,
3+
"cleanUrls": true,
4+
"public": true,
5+
"github": {
6+
"enabled": true,
7+
"silent": false
8+
}
9+
}

0 commit comments

Comments
 (0)