This is a Next.js personal portfolio website that automatically generates and syncs a README to your GitHub profile repository. Built with YAML-based configuration for easy content management.
- 🌐 Modern Next.js Website with Tailwind CSS & ShadCN UI
- 📝 YAML-Based Content - Easy to edit configuration files
- 🤖 Auto-Sync to GitHub - Keep your GitHub profile updated automatically
- 🏷️ Smart Project Filtering - Filter projects by technology tags
- 📱 Responsive Design - Works on all devices
- 🔄 Real-time Updates - Changes sync automatically via GitHub Actions
- 🌍 Bilingual Support - Documentation in English and Chinese
- Frontend: Next.js 15+, React, TypeScript, Tailwind CSS
- UI Components: ShadCN UI, Lucide Icons
- Content: YAML configuration files
- Automation: GitHub Actions, Node.js scripts
- Markdown: React-Markdown for proper formatting
git clone <your-repo-url>
cd your-repo-name
npm installCopy the example environment file and customize it:
cp .env.example .envEdit .env with your information:
# GitHub Configuration
GITHUB_USERNAME=YourGitHubUsername
GITHUB_PROFILE_REPO=YourGitHubUsername/YourGitHubUsername
# Git Configuration
GIT_USER_NAME=Your Full Name
GIT_USER_EMAIL=your.email@example.com
# Commit Configuration
COMMIT_MESSAGE=🤖 Auto-update profile README from website
COMMIT_BRANCH=main
# Language Configuration (en/zh)
DEFAULT_LANGUAGE=enEdit the YAML files in the config/ directory:
config/intro.yaml- Your name, title, contact info, quoteconfig/projects.yaml- Your projects with descriptions and tech tagsconfig/experience.yaml- Work experience and achievementsconfig/tech_stack.yaml- Technologies organized by categoriesconfig/education.yaml- Educational backgroundconfig/current_work.yaml- What you're currently working onconfig/learning.yaml- What you're currently learningconfig/fun_facts.yaml- Personal fun factsconfig/journey.yaml- Your tech journey timeline
# Test the setup
npm run test-sync
# Generate README from YAML
npm run generate-readme
# Run the website locally
npm run dev- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Name:
Profile Sync Token - Scopes: Select
repo(full control) - Copy the generated token
# Create repository with your exact username
gh repo create YourUsername/YourUsername --public --clone
cd YourUsername
echo "# Hi there! 👋" > README.md
git add . && git commit -m "Initial commit" && git push- Go to your website repository → Settings → Secrets and variables → Actions
- Add these secrets:
PROFILE_SYNC_TOKEN= Your personal access token
Go to Settings → Secrets and variables → Actions → Variables tab:
GITHUB_USERNAME= Your GitHub usernameGITHUB_PROFILE_REPO= YourUsername/YourUsernameGIT_USER_NAME= Your display nameGIT_USER_EMAIL= Your email
git add .
git commit -m "Setup auto-sync system"
git push origin mainnpm run dev # Start development server
npm run build # Build for production
npm run generate-readme # Generate README from YAML files
npm run deploy-profile # Deploy README to GitHub profile
npm run sync-github # Generate + Deploy in one command
npm run test-sync # Test all configurations- Edit YAML files in
config/directory - Push changes to your repository
- GitHub Actions automatically:
- Generates new README
- Updates your GitHub profile
- Takes 2-3 minutes
# Authenticate with GitHub CLI (one-time)
gh auth login
# Sync manually
npm run sync-github├── config/ # YAML configuration files
│ ├── intro.yaml # Personal intro & contact
│ ├── projects.yaml # Project portfolio
│ ├── experience.yaml # Work experience
│ ├── tech_stack.yaml # Technology skills
│ └── ... # Other content files
├── src/
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ │ ├── sections/ # Content sections
│ │ └── ui/ # UI components
│ ├── lib/ # Utility functions
│ └── types/ # TypeScript types
├── .github/workflows/ # GitHub Actions
├── generateReadme.js # README generator script
├── deployToGithub.js # GitHub sync script
├── .env # Environment variables
└── README.md # This file
- Create new YAML file in
config/ - Add corresponding component in
src/components/sections/ - Update types in
src/types/index.ts - Generator automatically detects new files
- Tailwind classes in components for styling
- ShadCN components for consistent UI
- Edit layout in
src/app/page.tsx
- Modify triggers in
.github/workflows/sync-profile-readme.yml - Update commit messages in
.env - Change target repository in environment variables
Sync Not Working?
npm run test-sync # Check all configurations
gh auth status # Verify GitHub authenticationREADME Not Generated?
npm run generate-readme # Test generation locally
# Check YAML syntax in config filesGitHub Actions Failing?
- Check Actions tab in your repository
- Verify
PROFILE_SYNC_TOKENsecret is set - Ensure target repository exists
- Check token permissions include
repo
这是一个基于Next.js的个人作品集网站,能够自动生成并同步README到您的GitHub个人资料仓库。使用YAML配置文件便于内容管理。
- 🌐 现代化Next.js网站 - 使用Tailwind CSS和ShadCN UI
- 📝 基于YAML的内容管理 - 易于编辑的配置文件
- 🤖 自动同步到GitHub - 保持GitHub资料自动更新
- 🏷️ 智能项目筛选 - 根据技术标签筛选项目
- 📱 响应式设计 - 支持所有设备
- 🔄 实时更新 - 通过GitHub Actions自动同步变更
- 🌍 双语支持 - 中英文文档
- 前端: Next.js 15+, React, TypeScript, Tailwind CSS
- UI组件: ShadCN UI, Lucide图标
- 内容: YAML配置文件
- 自动化: GitHub Actions, Node.js脚本
- Markdown: React-Markdown用于格式化
git clone <你的仓库地址>
cd 你的仓库名称
npm install复制示例环境文件并自定义:
cp .env.example .env编辑.env文件填入您的信息:
# GitHub配置
GITHUB_USERNAME=您的GitHub用户名
GITHUB_PROFILE_REPO=您的用户名/您的用户名
# Git配置
GIT_USER_NAME=您的全名
GIT_USER_EMAIL=your.email@example.com
# 提交配置
COMMIT_MESSAGE=🤖 从网站自动更新个人资料README
COMMIT_BRANCH=main
# 语言配置 (en/zh)
DEFAULT_LANGUAGE=zh编辑config/目录中的YAML文件:
config/intro.yaml- 姓名、标题、联系信息、座右铭config/projects.yaml- 项目作品集及技术标签config/experience.yaml- 工作经历和成就config/tech_stack.yaml- 按类别组织的技术栈config/education.yaml- 教育背景config/current_work.yaml- 当前工作内容config/learning.yaml- 正在学习的内容config/fun_facts.yaml- 个人趣事config/journey.yaml- 技术成长时间线
# 测试配置
npm run test-sync
# 从YAML生成README
npm run generate-readme
# 本地运行网站
npm run dev- 前往 GitHub设置 → 开发者设置 → 个人访问令牌 → 令牌(经典版)
- 点击"生成新令牌(经典版)"
- 名称:
Profile Sync Token - 权限:选择
repo(完全控制) - 复制生成的令牌
# 创建与您用户名完全相同的仓库
gh repo create 您的用户名/您的用户名 --public --clone
cd 您的用户名
echo "# 你好!👋" > README.md
git add . && git commit -m "Initial commit" && git push- 前往您的网站仓库 → 设置 → 密钥和变量 → Actions
- 添加以下密钥:
PROFILE_SYNC_TOKEN= 您的个人访问令牌
前往 设置 → 密钥和变量 → Actions → 变量选项卡:
GITHUB_USERNAME= 您的GitHub用户名GITHUB_PROFILE_REPO= 您的用户名/您的用户名GIT_USER_NAME= 您的显示名称GIT_USER_EMAIL= 您的邮箱
git add .
git commit -m "设置自动同步系统"
git push origin mainnpm run dev # 启动开发服务器
npm run build # 构建生产版本
npm run generate-readme # 从YAML文件生成README
npm run deploy-profile # 部署README到GitHub资料
npm run sync-github # 生成+部署一键完成
npm run test-sync # 测试所有配置- 编辑YAML文件 在
config/目录中 - 推送更改 到您的仓库
- GitHub Actions自动:
- 生成新的README
- 更新您的GitHub资料
- 需要2-3分钟
# 通过GitHub CLI认证(一次性)
gh auth login
# 手动同步
npm run sync-github├── config/ # YAML配置文件
│ ├── intro.yaml # 个人介绍和联系方式
│ ├── projects.yaml # 项目作品集
│ ├── experience.yaml # 工作经历
│ ├── tech_stack.yaml # 技术技能
│ └── ... # 其他内容文件
├── src/
│ ├── app/ # Next.js应用目录
│ ├── components/ # React组件
│ │ ├── sections/ # 内容区块
│ │ └── ui/ # UI组件
│ ├── lib/ # 工具函数
│ └── types/ # TypeScript类型
├── .github/workflows/ # GitHub Actions
├── generateReadme.js # README生成脚本
├── deployToGithub.js # GitHub同步脚本
├── .env # 环境变量
└── README.md # 此文件
- 在
config/中创建新YAML文件 - 在
src/components/sections/中添加对应组件 - 更新
src/types/index.ts中的类型 - 生成器自动检测新文件
- 在组件中使用Tailwind类进行样式设置
- 使用ShadCN组件保持UI一致性
- 编辑布局在
src/app/page.tsx中
- 修改触发条件在
.github/workflows/sync-profile-readme.yml中 - 更新提交消息在
.env中 - 更改目标仓库在环境变量中
同步不工作?
npm run test-sync # 检查所有配置
gh auth status # 验证GitHub认证README未生成?
npm run generate-readme # 本地测试生成
# 检查config文件中的YAML语法GitHub Actions失败?
- 检查仓库中的Actions选项卡
- 验证
PROFILE_SYNC_TOKEN密钥已设置 - 确保目标仓库存在
- 检查令牌权限包含
repo
Feel free to open issues and pull requests! | 欢迎提交问题和拉取请求!
MIT License | MIT许可证
Generated with ❤️ using Next.js and GitHub Actions | 使用Next.js和GitHub Actions构建