Skip to content

Commit 3011553

Browse files
committed
Add GitHub Pages deployment configuration
- Configure Vite for GitHub Pages with correct base path - Add GitHub Actions workflow for automatic deployment - Add gh-pages package for manual deployment option - Update README with live game link
1 parent 6152d07 commit 3011553

File tree

5 files changed

+1022
-6
lines changed

5 files changed

+1022
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Vue Tetris to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
cache-dependency-path: vue-tetris-clone/package-lock.json
23+
24+
- name: Install dependencies
25+
run: |
26+
cd vue-tetris-clone
27+
npm ci
28+
29+
- name: Build
30+
run: |
31+
cd vue-tetris-clone
32+
npm run build
33+
34+
- name: Deploy to GitHub Pages
35+
uses: peaceiris/actions-gh-pages@v3
36+
if: github.ref == 'refs/heads/main'
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: vue-tetris-clone/dist
40+
cname: # Optional: add your custom domain here

vue-tetris-clone/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ npm run build
5252
- Node.js 18+ (required for Vite and modern tooling)
5353
- Modern browser with ES2020 support
5454

55+
## 🎮 Play Online
56+
57+
**🚀 [Play Vue Tetris Clone](https://waynegreeley.github.io/vue-tetris/)**
58+
5559
## Current Status
5660

5761
**All Tasks Completed!**
@@ -77,9 +81,15 @@ npm run build
7781
- 👁️ **Ghost Piece Preview**: Shows where piece will land
7882
- 🔄 **Game State Management**: Start, pause, restart functionality
7983

80-
⚠️ **Development Server Note:**
81-
The current environment has Node.js v12.18.3, but Vite requires Node.js 18+. The code is ready and will work with a modern Node.js version. To run the development server, upgrade to Node.js 18+ and then use `npm run dev`.
84+
## Deployment
8285

83-
## Game Ready!
86+
The game is automatically deployed to GitHub Pages using GitHub Actions. Every push to the main branch triggers a new deployment.
8487

85-
The Vue Tetris Clone is fully implemented and ready to play once you upgrade Node.js!
88+
### Manual Deployment (if needed)
89+
```bash
90+
cd vue-tetris-clone
91+
npm run deploy
92+
```
93+
94+
⚠️ **Development Server Note:**
95+
The current environment has Node.js v12.18.3, but Vite requires Node.js 18+. The code is ready and will work with a modern Node.js version. To run the development server, upgrade to Node.js 18+ and then use `npm run dev`.

0 commit comments

Comments
 (0)