1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+ pull_request :
7+ branches : [ main, master ]
8+
9+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+ permissions :
11+ contents : read
12+ pages : write
13+ id-token : write
14+
15+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+ concurrency :
18+ group : " pages"
19+ cancel-in-progress : false
20+
21+ jobs :
22+ build :
23+ runs-on : ubuntu-latest
24+
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v4
28+
29+ - name : Setup Node.js
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : ' 18'
33+ cache : ' npm'
34+ cache-dependency-path : ' apps/dice-verse/package-lock.json'
35+
36+ - name : Install dependencies
37+ run : |
38+ cd apps/dice-verse
39+ npm ci
40+
41+ - name : Build dice-verse
42+ run : |
43+ cd apps/dice-verse
44+ npm run build
45+
46+ - name : Create main index.html
47+ run : |
48+ mkdir -p dist
49+ cat > dist/index.html << 'EOF'
50+ <!DOCTYPE html>
51+ <html lang="zh-CN">
52+ <head>
53+ <meta charset="UTF-8">
54+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
55+ <title>Weekly Vibe Coding - 一百个创意应用</title>
56+ <style>
57+ * {
58+ margin: 0;
59+ padding: 0;
60+ box-sizing: border-box;
61+ }
62+ body {
63+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
64+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
65+ min-height: 100vh;
66+ display: flex;
67+ align-items: center;
68+ justify-content: center;
69+ padding: 20px;
70+ }
71+ .container {
72+ background: white;
73+ border-radius: 20px;
74+ padding: 40px;
75+ box-shadow: 0 20px 40px rgba(0,0,0,0.1);
76+ text-align: center;
77+ max-width: 900px;
78+ width: 100%;
79+ }
80+ h1 {
81+ color: #333;
82+ margin-bottom: 20px;
83+ font-size: 2.5rem;
84+ }
85+ .subtitle {
86+ color: #666;
87+ margin-bottom: 40px;
88+ font-size: 1.2rem;
89+ }
90+ .deployment-info {
91+ background: #f0f8ff;
92+ border-left: 4px solid #667eea;
93+ padding: 20px;
94+ margin-bottom: 30px;
95+ text-align: left;
96+ border-radius: 8px;
97+ }
98+ .deployment-info h3 {
99+ color: #333;
100+ margin-bottom: 10px;
101+ }
102+ .deployment-info p {
103+ color: #666;
104+ line-height: 1.6;
105+ }
106+ .apps-grid {
107+ display: grid;
108+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
109+ gap: 25px;
110+ margin-top: 30px;
111+ }
112+ .app-card {
113+ background: #f8f9fa;
114+ border-radius: 15px;
115+ padding: 30px 20px;
116+ text-decoration: none;
117+ color: #333;
118+ transition: all 0.3s ease;
119+ border: 2px solid transparent;
120+ position: relative;
121+ overflow: hidden;
122+ }
123+ .app-card:hover {
124+ transform: translateY(-5px);
125+ box-shadow: 0 15px 35px rgba(0,0,0,0.15);
126+ border-color: #667eea;
127+ }
128+ .app-card::before {
129+ content: '';
130+ position: absolute;
131+ top: 0;
132+ left: 0;
133+ right: 0;
134+ height: 4px;
135+ background: linear-gradient(90deg, #667eea, #764ba2);
136+ }
137+ .app-icon {
138+ font-size: 3.5rem;
139+ margin-bottom: 15px;
140+ }
141+ .app-title {
142+ font-size: 1.4rem;
143+ font-weight: 600;
144+ margin-bottom: 10px;
145+ }
146+ .app-desc {
147+ color: #666;
148+ font-size: 0.95rem;
149+ line-height: 1.5;
150+ }
151+ .app-status {
152+ display: inline-block;
153+ padding: 4px 12px;
154+ border-radius: 20px;
155+ font-size: 0.8rem;
156+ font-weight: 500;
157+ margin-top: 10px;
158+ }
159+ .status-live {
160+ background: #e8f5e8;
161+ color: #2d5a2d;
162+ }
163+ .status-coming {
164+ background: #fff3cd;
165+ color: #856404;
166+ }
167+ .coming-soon {
168+ opacity: 0.7;
169+ cursor: not-allowed;
170+ }
171+ .coming-soon:hover {
172+ transform: none;
173+ box-shadow: none;
174+ border-color: transparent;
175+ }
176+ .footer {
177+ margin-top: 40px;
178+ padding-top: 20px;
179+ border-top: 1px solid #eee;
180+ color: #999;
181+ font-size: 0.9rem;
182+ }
183+ </style>
184+ </head>
185+ <body>
186+ <div class="container">
187+ <h1>🎯 Weekly Vibe Coding</h1>
188+ <p class="subtitle">用提示词实现一百个创意应用</p>
189+
190+ <div class="deployment-info">
191+ <h3>🚀 GitHub Pages 部署</h3>
192+ <p>本项目采用 GitHub Actions 自动部署到 GitHub Pages,每次推送到主分支时自动构建和部署所有应用。</p>
193+ </div>
194+
195+ <div class="apps-grid">
196+ <a href="./dice-verse/" class="app-card">
197+ <div class="app-icon">🎲</div>
198+ <div class="app-title">Dice Verse</div>
199+ <div class="app-desc">多功能骰子应用,支持各种游戏场景的骰子投掷和统计功能</div>
200+ <span class="app-status status-live">✅ 已部署</span>
201+ </a>
202+
203+ <div class="app-card coming-soon">
204+ <div class="app-icon">📝</div>
205+ <div class="app-title">Todo Master</div>
206+ <div class="app-desc">智能待办事项管理器,支持优先级、分类和提醒功能</div>
207+ <span class="app-status status-coming">🚧 开发中</span>
208+ </div>
209+
210+ <div class="app-card coming-soon">
211+ <div class="app-icon">🎨</div>
212+ <div class="app-title">Color Palette</div>
213+ <div class="app-desc">专业调色板工具,支持色彩搭配和导出功能</div>
214+ <span class="app-status status-coming">🚧 开发中</span>
215+ </div>
216+
217+ <div class="app-card coming-soon">
218+ <div class="app-icon">⏱️</div>
219+ <div class="app-title">Pomodoro Timer</div>
220+ <div class="app-desc">番茄工作法计时器,帮助提高工作效率和专注力</div>
221+ <span class="app-status status-coming">🚧 开发中</span>
222+ </div>
223+
224+ <div class="app-card coming-soon">
225+ <div class="app-icon">🌤️</div>
226+ <div class="app-title">Weather Dashboard</div>
227+ <div class="app-desc">精美的天气仪表板,提供详细的天气信息和预报</div>
228+ <span class="app-status status-coming">🚧 开发中</span>
229+ </div>
230+
231+ <div class="app-card coming-soon">
232+ <div class="app-icon">💰</div>
233+ <div class="app-title">Expense Tracker</div>
234+ <div class="app-desc">个人财务管理工具,记录和分析日常支出</div>
235+ <span class="app-status status-coming">🚧 开发中</span>
236+ </div>
237+ </div>
238+
239+ <div class="footer">
240+ <p>🎯 目标:用提示词实现一百个创意应用 | 当前进度:1/100</p>
241+ </div>
242+ </div>
243+ </body>
244+ </html>
245+ EOF
246+
247+ - name : Copy dice-verse build to dist
248+ run : |
249+ cp -r apps/dice-verse/dist dist/dice-verse
250+
251+ - name : Setup Pages
252+ uses : actions/configure-pages@v4
253+
254+ - name : Upload artifact
255+ uses : actions/upload-pages-artifact@v3
256+ with :
257+ path : ' ./dist'
258+
259+ deploy :
260+ environment :
261+ name : github-pages
262+ url : ${{ steps.deployment.outputs.page_url }}
263+ runs-on : ubuntu-latest
264+ needs : build
265+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
266+ steps :
267+ - name : Deploy to GitHub Pages
268+ id : deployment
269+ uses : actions/deploy-pages@v4
0 commit comments