Skip to content

Commit dc21c2c

Browse files
authored
Merge pull request #7 from cederache/feature/new-template
Feature/new template
2 parents b303f1c + 5e50ecc commit dc21c2c

96 files changed

Lines changed: 13050 additions & 2830 deletions

Some content is hidden

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

.github/workflows/deploy-pages.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
if: github.event.pull_request.merged == true
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout master
24+
uses: actions/checkout@v4
25+
with:
26+
ref: master
27+
28+
- uses: pnpm/action-setup@v4
29+
with:
30+
version: 10
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 22
35+
cache: pnpm
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build
41+
env:
42+
VITE_GITHUB_TOKEN: ${{ secrets.VITE_GITHUB_TOKEN }}
43+
run: pnpm build
44+
45+
- uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: dist
48+
49+
deploy:
50+
if: github.event.pull_request.merged == true
51+
needs: build
52+
runs-on: ubuntu-latest
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
steps:
57+
- id: deployment
58+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
dist

README.md

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,93 @@
11
# cederache.github.io
22

3-
This is a personal website generated with [gitfolio](https://github.com/imfunniee/gitfolio)
3+
Personal site hosted on [GitHub Pages](https://pages.github.com/). It shows a hero section, a live list of public repositories from the GitHub API, and an about/contact area.
44

5-
The Github repositories are automatically refreshed.
5+
## Stack
66

7-
To serve website, run `npm run serve`
7+
- [Vite](https://vitejs.dev/) + [React](https://react.dev/) 18 + [TypeScript](https://www.typescriptlang.org/)
8+
- [Tailwind CSS](https://tailwindcss.com/) and [shadcn/ui](https://ui.shadcn.com/) (Radix primitives)
9+
- [TanStack Query](https://tanstack.com/query) for GitHub API data
10+
- [React Router](https://reactrouter.com/) for routing
11+
- [Vitest](https://vitest.dev/) and [Testing Library](https://testing-library.com/react) for unit tests
12+
13+
## Prerequisites
14+
15+
- Node.js (LTS recommended)
16+
- [pnpm](https://pnpm.io/) — the repo pins a `packageManager` version in `package.json`
17+
18+
## Setup
19+
20+
```bash
21+
pnpm install
22+
```
23+
24+
## Development
25+
26+
```bash
27+
pnpm dev
28+
```
29+
30+
The dev server listens on port **8080** (see `vite.config.ts`).
31+
32+
## Build
33+
34+
```bash
35+
pnpm build
36+
```
37+
38+
Output goes to `dist/`. Preview the production build with `pnpm preview`.
39+
40+
## Deploy to GitHub Pages ([gh-pages](https://www.npmjs.com/package/gh-pages))
41+
42+
This mirrors the flow from [gitname/react-gh-pages](https://github.com/gitname/react-gh-pages), adapted for **Vite** (build output is `dist/`, not `build/`) and a **user site** repo (`username.github.io`), where `homepage` is `https://cederache.github.io` with no repository path segment.
43+
44+
1. **One-time:** In the GitHub repo → **Settings****Pages****Build and deployment**: source **Deploy from a branch**, branch **`gh-pages`** folder **`/ (root)`**, then Save.
45+
2. Ensure your local `origin` remote points at this repository (same as the tutorial’s step 6).
46+
3. From the project root:
47+
48+
```bash
49+
pnpm run deploy
50+
```
51+
52+
(`pnpm deploy` is a different pnpm command; use `run deploy` for this script.)
53+
54+
That runs `predeploy` (production build) then pushes the contents of `dist/` to the `gh-pages` branch. Optional custom commit message:
55+
56+
```bash
57+
pnpm run deploy -- -m "Deploy site"
58+
```
59+
60+
Keep deploying **source** on your default branch (`git push`) separately from `pnpm run deploy`, which only updates the **`gh-pages`** branch with the built site.
61+
62+
## Environment variables
63+
64+
| Variable | Required | Purpose |
65+
|----------|----------|---------|
66+
| `VITE_GITHUB_TOKEN` | No | GitHub personal access token (classic fine-grained with `public_repo` or read-only repo scope). Without it, the app uses unauthenticated API calls, which have a lower rate limit. |
67+
68+
Create a `.env` or `.env.local` in the project root (do not commit secrets):
69+
70+
```bash
71+
VITE_GITHUB_TOKEN=ghp_...
72+
```
73+
74+
## Scripts
75+
76+
| Command | Description |
77+
|---------|-------------|
78+
| `pnpm dev` | Start Vite dev server |
79+
| `pnpm build` | Production build |
80+
| `pnpm build:dev` | Build in development mode |
81+
| `pnpm preview` | Serve `dist/` locally |
82+
| `pnpm lint` | Run ESLint |
83+
| `pnpm test` | Run Vitest once |
84+
| `pnpm test:watch` | Vitest watch mode |
85+
| `pnpm run deploy` | Build and publish `dist/` to the `gh-pages` branch |
86+
87+
## Project layout
88+
89+
- `src/` — application code (`pages/`, `components/`, `hooks/`, etc.)
90+
- `public/` — static assets served as-is
91+
- `index.html` — Vite entry HTML
92+
93+
Repository data is fetched for the GitHub user `cederache`; adjust `GITHUB_USERNAME` in `src/hooks/useGitHubRepos.ts` if you fork this for another account.

blog/list.json

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

blog/my-first-post/scotland.JPG

-2.21 MB
Binary file not shown.

0 commit comments

Comments
 (0)