Skip to content

Commit e02fe18

Browse files
authored
feat: v1.0.0 (#1)
1 parent 005e6ee commit e02fe18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+6701
-3192
lines changed

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ node_modules
55
.husky
66
.direnv
77
flake.lock
8-
flake.nix
8+
flake.nix
9+
*.md
10+
*.env.*

.github/workflows/preview.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Preview Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main, "refactor/app-router"]
7+
paths:
8+
- "app/**"
9+
- "next.config.js"
10+
- "package.json"
11+
- "tailwind.config.js"
12+
- "Dockerfile"
13+
14+
jobs:
15+
push_to_registry:
16+
name: Push Image to Docker Hub
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
25+
- name: Log Into Docker Hub
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_TOKEN }}
30+
31+
- name: Set Short SHA
32+
id: short_sha
33+
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
34+
35+
- name: Build/Push Image
36+
uses: docker/build-push-action@v4
37+
with:
38+
context: .
39+
push: true
40+
build-args: |
41+
NEXT_PUBLIC_IS_PREVIEW=1
42+
NEXT_PUBLIC_BUILD_SHA=${{ steps.short_sha.outputs.short_sha }}
43+
NEXT_PUBLIC_BUILD_ID=${{ github.run_id }}
44+
NEXT_PUBLIC_BUILD_NUM=${{ github.run_number }}
45+
secrets: |
46+
REPOS_READ_ONLY=${{ secrets.REPOS_READ_ONLY }}
47+
tags: ${{ secrets.DOCKER_USERNAME }}/website:preview
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

.github/workflows/publish.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Production Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
push_to_registry:
10+
name: Push Image to Docker Hub
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
19+
- name: Log Into Docker Hub
20+
uses: docker/login-action@v2
21+
with:
22+
username: ${{ secrets.DOCKER_USERNAME }}
23+
password: ${{ secrets.DOCKER_TOKEN }}
24+
25+
- name: Set Short SHA
26+
id: short_sha
27+
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
28+
29+
- name: Build/Push Image
30+
uses: docker/build-push-action@v4
31+
with:
32+
context: .
33+
push: true
34+
build-args:
35+
NEXT_PUBLIC_BUILD_SHA=${{ steps.short_sha.outputs.short_sha }}
36+
NEXT_PUBLIC_BUILD_ID=${{ github.run_id }}
37+
NEXT_PUBLIC_BUILD_NUM=${{ github.run_number }}
38+
secrets: |
39+
REPOS_READ_ONLY=${{ secrets.REPOS_READ_ONLY }}
40+
tags: ${{ secrets.DOCKER_USERNAME }}/website:${{ github.ref_name }}

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,13 @@ next-env.d.ts
3737

3838
# nix
3939
.direnv/
40-
.envrc
40+
.envrc
41+
.env*
42+
43+
# yarn
44+
.yarn/*
45+
!.yarn/releases
46+
!.yarn/plugins
47+
!.yarn/sdks
48+
!.yarn/versions
49+
.pnp.*

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

Dockerfile

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,58 @@
1-
# Installing Dependencies
2-
FROM node:18-alpine AS deps
1+
# Dependencies Image
2+
FROM node:20-alpine AS deps
33
RUN apk add --no-cache libc6-compat
44
WORKDIR /app
5-
COPY package.json yarn.lock ./
6-
RUN yarn install --frozen-lockfile
5+
6+
COPY package.json yarn.lock .yarnrc.yml ./
7+
COPY .yarn ./.yarn
8+
9+
RUN yarn set version berry
10+
RUN yarn install --immutable
711
RUN yarn add sharp
812

9-
# Building Website
10-
FROM node:18-alpine AS builder
13+
# Build Image
14+
FROM node:20-alpine AS builder
1115
WORKDIR /app
1216
COPY --from=deps /app/node_modules ./node_modules
1317
COPY . .
14-
RUN yarn build
18+
19+
ENV NEXT_TELEMETRY_DISABLED 1
20+
21+
# Keep as empty string as Typescript parses empty strings as false
22+
ARG NEXT_PUBLIC_IS_PREVIEW=""
23+
ENV NEXT_PUBLIC_IS_PREVIEW=$NEXT_PUBLIC_IS_PREVIEW
24+
ARG NEXT_PUBLIC_BUILD_SHA
25+
ENV NEXT_PUBLIC_BUILD_SHA=$NEXT_PUBLIC_BUILD_SHA
26+
ARG NEXT_PUBLIC_BUILD_ID
27+
ENV NEXT_PUBLIC_BUILD_ID=$NEXT_PUBLIC_BUILD_ID
28+
ARG NEXT_PUBLIC_BUILD_NUM
29+
ENV NEXT_PUBLIC_BUILD_NUM=$NEXT_PUBLIC_BUILD_NUM
30+
31+
RUN --mount=type=secret,id=REPOS_READ_ONLY \
32+
REPOS_READ_ONLY=$(cat /run/secrets/REPOS_READ_ONLY) \
33+
yarn build
1534

1635
# Production Image
17-
FROM node:18-alpine AS runner
36+
FROM node:20-alpine AS runner
1837
WORKDIR /app
1938
ENV NODE_ENV production
39+
ENV NEXT_TELEMETRY_DISABLED 1
40+
41+
RUN addgroup -g 1001 -S nodejs
42+
RUN adduser -S nextjs -u 1001
2043

21-
RUN addgroup --system --gid 1001 nextjsgroup
22-
RUN adduser --system --uid 1001 nextjsuser
44+
COPY --from=builder /app/public ./public
2345

2446
# Automatically leverage output traces to reduce image size
2547
# https://nextjs.org/docs/advanced-features/output-file-tracing
26-
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/public ./public
27-
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/package.json ./package.json
28-
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/.next/standalone ./
29-
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/.next/static ./.next/static
30-
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/node_modules/next/dist/compiled/jest-worker ./node_modules/next/dist/compiled/jest-worker
48+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
49+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
3150

32-
USER nextjsuser
51+
USER nextjs
3352

3453
EXPOSE 3000
35-
ENTRYPOINT ["node", "server.js"]
54+
55+
ENV PORT 3000
56+
ENV HOSTNAME localhost
57+
58+
CMD ["node", "server.js"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</h1>
44

55
<h3 align="center">
6-
<a href="https://goudham.com"><img src="assets/me-circle.png" width="150px" alt=""/></a><br>
6+
<a href="https://goudham.com"><img src="public/profile-picture-circle.png" width="150px" alt=""/></a><br>
77
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/bbc6efd2096b8cfa82d00f8ad1099b1b2b34fc8f/assets/misc/transparent.png" height="30" width="0px"/>
88
<a href="https://goudham.com">✨ https://goudham.com ✨</a>
99
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/bbc6efd2096b8cfa82d00f8ad1099b1b2b34fc8f/assets/misc/transparent.png" height="30" width="0px"/>
File renamed without changes.

app/components/About.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { FancyUnderline, GroupedText, Text } from "./utils/Text";
2+
3+
export const About = () => {
4+
return (
5+
<GroupedText className="text-center">
6+
<Text>
7+
I am a{" "}
8+
<FancyUnderline className="font-semibold" decoration="decoration-green">
9+
software engineer
10+
</FancyUnderline>{" "}
11+
at the BBC and a{" "}
12+
<FancyUnderline className="font-semibold" decoration="decoration-red">student</FancyUnderline>,
13+
currently pursuing a BSc in Software Engineering at the University of
14+
Glasgow.
15+
</Text>
16+
<Text>
17+
You&apos;ll usually find me nerding out about technology and playing
18+
video games. I also really enjoy contributing to open source projects,
19+
mainly{" "}
20+
<FancyUnderline className="font-semibold" decoration="decoration-peach">
21+
Catppuccin
22+
</FancyUnderline>
23+
.
24+
</Text>
25+
</GroupedText>
26+
);
27+
};

app/components/Footer.tsx

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import { Text } from "./utils/Text";
2+
import {
3+
GitHub,
4+
Gitea,
5+
Instagram,
6+
LinkedIn,
7+
Twitter,
8+
} from "./icons/SocialMedia";
9+
import Link from "next/link";
10+
import { Heart } from "./icons/Heart";
11+
import { ExternalLink } from "./icons/ExternalLink";
12+
13+
export const Footer = () => {
14+
return (
15+
<footer className="border-t-2 border-surface1 w-full text-subtext1">
16+
<div className="flex flex-col justify-center items-center space-y-6 pt-10 pb-20">
17+
<div className="text-center">
18+
<p className="text-lg lg:text-xl xl:text-2xl">
19+
Designed With <Heart />
20+
</p>
21+
<Text>&copy; {new Date().getFullYear()} Goudham Suresh</Text>
22+
</div>
23+
<BuildInfo />
24+
<SocialMediaRow />
25+
</div>
26+
</footer>
27+
);
28+
};
29+
30+
const BuildInfo = () => {
31+
return (
32+
<div className="text-center text-md lg:text-lg xl:text-xl">
33+
<p>{process.env.NEXT_PUBLIC_IS_PREVIEW ? "Preview" : "Release"} Build</p>
34+
<p>
35+
GitHub SHA:{" "}
36+
<Link
37+
rel="noopener noreferrer"
38+
target="_blank"
39+
className="hocus:underline hocus:decoration-solid hocus:underline-offset-1"
40+
href={`https://github.com/sgoudham/website/commit/${process.env.NEXT_PUBLIC_BUILD_SHA}`}
41+
>
42+
{process.env.NEXT_PUBLIC_BUILD_SHA}&#8201;
43+
<ExternalLink />
44+
</Link>
45+
</p>
46+
<p>
47+
Build ID:{" "}
48+
<Link
49+
rel="noopener noreferrer"
50+
target="_blank"
51+
className="hocus:underline hocus:decoration-solid hocus:underline-offset-1"
52+
href={`https://github.com/sgoudham/website/actions/runs/${process.env.NEXT_PUBLIC_BUILD_ID}`}
53+
>
54+
{process.env.NEXT_PUBLIC_BUILD_ID}&#8201;
55+
<ExternalLink />
56+
</Link>
57+
</p>
58+
<p>Build Num: #{process.env.NEXT_PUBLIC_BUILD_NUM}</p>
59+
</div>
60+
);
61+
};
62+
63+
const SocialMediaRow = () => {
64+
return (
65+
<div className="flex gap-3 items-center">
66+
<a
67+
className="group focus:ring-2 focus:ring-blue ring-offset-0"
68+
aria-label="Follow Me On GitHub"
69+
href="https://github.com/sgoudham"
70+
>
71+
<GitHub />
72+
</a>
73+
<a
74+
className="group focus:ring-2 focus:ring-blue ring-offset-0"
75+
aria-label="Visit My Gitea Instance"
76+
href="https://gitea.goudham.com"
77+
>
78+
<Gitea />
79+
</a>
80+
<a
81+
className="group focus:ring-2 focus:ring-blue ring-offset-0"
82+
aria-label="Follow Me On LinkedIn"
83+
href="https://linkedin.com/in/sgoudham"
84+
>
85+
<LinkedIn />
86+
</a>
87+
<a
88+
className="group focus:ring-2 focus:ring-blue ring-offset-0"
89+
aria-label="Follow Me On Twitter"
90+
href="https://twitter.com/RealGoudham"
91+
>
92+
<Twitter />
93+
</a>
94+
<a
95+
className="group focus:ring-2 focus:ring-blue ring-offset-0"
96+
aria-label="Follow Me On Instagram"
97+
href="https://instagram.com/sgoudham"
98+
>
99+
<Instagram />
100+
</a>
101+
</div>
102+
);
103+
};

app/components/Header.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Wave } from "./icons/Wave";
2+
import { H1 } from "./utils/Titles";
3+
4+
export const Header = () => {
5+
return (
6+
<H1>
7+
Hiya{" "}
8+
<div className="inline-block motion-safe:animate-waving-hand">
9+
<Wave />
10+
</div>
11+
, I&#39;m Goudham
12+
</H1>
13+
);
14+
};

0 commit comments

Comments
 (0)