Skip to content

Commit 31f65eb

Browse files
committed
add github action
1 parent b10061b commit 31f65eb

4 files changed

Lines changed: 72 additions & 35 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy portfolio to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '18'
19+
20+
- name: Cache npm
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-node-${{ hashFiles('portfolio/package-lock.json', 'portfolio/pnpm-lock.yaml', 'portfolio/package.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
28+
- name: Install dependencies (portfolio)
29+
run: npm install --prefix portfolio
30+
31+
- name: Build (portfolio)
32+
run: npm run build --prefix portfolio
33+
34+
- name: Deploy to gh-pages
35+
run: npm run gh-pages --prefix portfolio
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

portfolio/src/components/Homepage/Homepage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import Techstack from "../Techstack/Techstack";
55
function Homepage() {
66
return (
77
<>
8-
<div id="home">
8+
<div id="home">
99
<MyInfo />
1010
</div>
11-
<div id="timeline">
11+
<div id="timeline">
1212
<MyTimeLine />
1313
</div>
14-
<div id="tech-stack">
14+
<div id="tech-stack">
1515
<Techstack />
1616
</div>
1717
</>

portfolio/src/components/NavBar/Navbar.tsx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -99,39 +99,39 @@ function Navbar() {
9999
onClose={handleCloseNavMenu}
100100
>
101101
{pages.map((page) => (
102-
<Button
103-
key={page}
104-
onClick={() => {
105-
const slug = page.replace(/\s+/g, "-").toLowerCase();
106-
if (page === "Resume") {
107-
window.open(Resume, "_blank"); // Open resume in new tab
108-
} else if (page === "Projects") {
109-
window.location.hash = "#/project"; // Use hash-based navigation
110-
} else if (page === "Open Source") {
111-
window.location.hash = "#/opensource"; // Use hash-based navigation
102+
<Button
103+
key={page}
104+
onClick={() => {
105+
const slug = page.replace(/\s+/g, "-").toLowerCase();
106+
if (page === "Resume") {
107+
window.open(Resume, "_blank"); // Open resume in new tab
108+
} else if (page === "Projects") {
109+
window.location.hash = "#/project"; // Use hash-based navigation
110+
} else if (page === "Open Source") {
111+
window.location.hash = "#/opensource"; // Use hash-based navigation
112+
} else {
113+
if (window.location.hash !== "#/") {
114+
// Store target section in sessionStorage
115+
sessionStorage.setItem("scrollTo", slug);
116+
window.location.hash = "#/"; // Redirect to homepage
112117
} else {
113-
if (window.location.hash !== "#/") {
114-
// Store target section in sessionStorage
115-
sessionStorage.setItem("scrollTo", slug);
116-
window.location.hash = "#/"; // Redirect to homepage
117-
} else {
118-
const el = document.getElementById(slug);
119-
el?.scrollIntoView({ behavior: "smooth", block: "start" });
120-
}
118+
const el = document.getElementById(slug);
119+
el?.scrollIntoView({ behavior: "smooth", block: "start" });
121120
}
122-
}}
123-
sx={{
124-
my: 0,
125-
display: "block",
126-
color: mode == "light" ? "black" : "white",
127-
p: 1,
128-
}}
129-
>
130-
<Typography sx={{ textAlign: "center" }}>
131-
{page}
132-
</Typography>
133-
</Button>
134-
))}
121+
}
122+
}}
123+
sx={{
124+
my: 0,
125+
display: "block",
126+
color: mode == "light" ? "black" : "white",
127+
p: 1,
128+
}}
129+
>
130+
<Typography sx={{ textAlign: "center" }}>
131+
{page}
132+
</Typography>
133+
</Button>
134+
))}
135135
</Menu>
136136
</Box>
137137
<Box

portfolio/src/components/Projects/ProjectCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function ProjectCard(props: ProjectInfo) {
5252
<CardContent>
5353
<Typography variant="body1">{Description}</Typography>
5454
</CardContent>
55-
<CardActions title="Learn More!" disableSpacing sx={{padding: 0}}>
55+
<CardActions title="Learn More!" disableSpacing sx={{ padding: 0 }}>
5656
<ExpandMore
5757
expand={expanded}
5858
data-expanded={expanded}

0 commit comments

Comments
 (0)