Skip to content

Commit ae566cd

Browse files
Initial site setup
1 parent df56839 commit ae566cd

28 files changed

Lines changed: 4443 additions & 851 deletions

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.next
3+
.git
4+
.gitignore
5+
README.md
6+
npm-debug.log

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
cache: "npm"
18+
- run: npm ci
19+
- run: npm run lint
20+
- run: npm run test
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy to Cloud Run
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
env:
12+
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
13+
REGION: ${{ secrets.GCP_REGION }}
14+
SERVICE: ${{ secrets.CLOUD_RUN_SERVICE }}
15+
GAR_LOCATION: ${{ secrets.GAR_LOCATION }}
16+
GAR_REPOSITORY: ${{ secrets.GAR_REPOSITORY }}
17+
IMAGE_NAME: kinin-code
18+
19+
jobs:
20+
deploy:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- id: auth
26+
uses: google-github-actions/auth@v2
27+
with:
28+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }}
29+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
30+
31+
- uses: google-github-actions/setup-gcloud@v2
32+
with:
33+
project_id: ${{ secrets.GCP_PROJECT_ID }}
34+
35+
- name: Configure Docker
36+
run: gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev --quiet
37+
38+
- name: Build image
39+
run: docker build -t ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} .
40+
41+
- name: Push image
42+
run: docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
43+
44+
- name: Deploy to Cloud Run
45+
run: >
46+
gcloud run deploy ${{ env.SERVICE }}
47+
--image ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
48+
--region ${{ env.REGION }}
49+
--platform managed
50+
--allow-unauthenticated
51+
--port 8080

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM node:24-bookworm-slim AS base
2+
3+
ENV NODE_ENV=production
4+
ENV NEXT_TELEMETRY_DISABLED=1
5+
WORKDIR /app
6+
7+
FROM base AS deps
8+
COPY package.json package-lock.json ./
9+
RUN npm ci
10+
11+
FROM base AS builder
12+
COPY --from=deps /app/node_modules ./node_modules
13+
COPY . .
14+
RUN npm run build
15+
16+
FROM base AS runner
17+
ENV PORT=8080
18+
ENV HOSTNAME=0.0.0.0
19+
WORKDIR /app
20+
21+
COPY --from=builder /app/public ./public
22+
COPY --from=builder /app/.next/standalone ./
23+
COPY --from=builder /app/.next/static ./.next/static
24+
25+
EXPOSE 8080
26+
CMD ["node", "server.js"]

README.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1+
# Kinin Code
22

3-
## Getting Started
3+
Portfolio + full-stack landing site built with Next.js and an optional 3D model.
44

5-
First, run the development server:
5+
## Development
66

77
```bash
8+
npm install
89
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
1510
```
1611

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
12+
Open `http://localhost:3000`.
1813

19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
14+
## 3D Model
2015

21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
16+
Export the Blender model to GLB and place it here:
2217

23-
## Learn More
24-
25-
To learn more about Next.js, take a look at the following resources:
26-
27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29-
30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
18+
```
19+
public/models/computer.glb
20+
```
3121

32-
## Deploy on Vercel
22+
If the model is missing, the hero uses a placeholder mesh.
3323

34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
24+
## Deploy (Cloud Run + Cloudflare)
3525

36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
26+
See `docs/deploy.md` for setup steps and GitHub Actions secrets.

docs/deploy.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Cloud Run + Cloudflare deploy
2+
3+
## 1) GCP hazırlık
4+
- Artifact Registry repo oluştur (Docker):
5+
- Region: `GAR_LOCATION` (ör. `europe-west1`)
6+
- Repo adı: `GAR_REPOSITORY` (ör. `web-images`)
7+
- Cloud Run servisi oluştur (ilk deploy ile de oluşur).
8+
- Workload Identity Federation + service account:
9+
- `GCP_WORKLOAD_ID_PROVIDER`
10+
- `GCP_SERVICE_ACCOUNT`
11+
- Service account yetkileri:
12+
- Artifact Registry Writer
13+
- Cloud Run Admin
14+
- Service Account User
15+
16+
## 2) GitHub secrets
17+
Repo Settings → Secrets and variables → Actions:
18+
- `GCP_PROJECT_ID`
19+
- `GCP_REGION` (Cloud Run region, ör. `europe-west1`)
20+
- `CLOUD_RUN_SERVICE`
21+
- `GAR_LOCATION`
22+
- `GAR_REPOSITORY`
23+
- `GCP_WORKLOAD_ID_PROVIDER`
24+
- `GCP_SERVICE_ACCOUNT`
25+
26+
## 3) Cloudflare
27+
- Domain’i Cloudflare’a ekle.
28+
- Cloud Run URL’i için CNAME oluştur:
29+
- `@` veya `www``your-service-<hash>-<region>.a.run.app`
30+
- SSL/TLS mode: Full (strict)
31+
32+
## 4) İlk deploy
33+
- `main` branch’e push et.
34+
- GitHub Actions workflow `Deploy to Cloud Run` otomatik çalışır.
35+
36+
## 5) Sağlık kontrolü
37+
- `https://<domain>/api/healthz`

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
4+
output: "standalone",
55
};
66

77
export default nextConfig;

0 commit comments

Comments
 (0)