1
0
Fork 0
mirror of https://github.com/imjasonh/dodec synced 2026-07-07 01:32:17 +00:00

Add GitHub Pages deployment workflow

- Create GitHub Actions workflow to build TypeScript on push
- Deploy compiled files to GitHub Pages automatically
- Keep game.js out of main branch (stays in .gitignore)
- Update README with deployment instructions and game info

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-06-10 01:25:37 -04:00
parent 0d8510d3dc
commit d7bff894db
Failed to extract signature
2 changed files with 95 additions and 12 deletions

53
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Build and Deploy to GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository except node_modules
path: '.'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -1,8 +1,24 @@
# Snub Dodecahedron Game
# Globetrotter
A 3D interactive snub dodecahedron game built with Three.js and TypeScript.
A 3D strategy game played on a snub dodecahedron planet. Control rovers to explore, conquer, and defend territories while building structures and engaging in tactical combat.
## Development
## Play Online
Once GitHub Pages is set up, the game will be available at:
`https://[your-username].github.io/dodec/`
## Setup GitHub Pages
1. Go to your repository on GitHub
2. Click on "Settings" tab
3. Scroll down to "Pages" in the left sidebar
4. Under "Build and deployment":
- Source: Select "GitHub Actions"
5. Push to main branch or manually trigger the workflow
6. Wait a few minutes for the deployment
7. Your game will be live at the URL above!
## Local Development
### Prerequisites
@ -36,16 +52,30 @@ A 3D interactive snub dodecahedron game built with Three.js and TypeScript.
- `tsconfig.json` - TypeScript configuration
- `package.json` - Project configuration and dependencies
## Features
## Game Features
- 3D snub dodecahedron with mathematical precision
- Mouse rotation controls
- Face selection and highlighting
- Click interactions for game logic
- TypeScript for type safety
- 3D snub dodecahedron game board (92 faces)
- Turn-based strategy for 2 players (Red vs Green)
- Pentagon faces are strategic HQ spaces
- Move, shoot, and fortify actions
- Range-based combat with dice rolls
- Fortifications block enemy movement
- Win by eliminating all enemy rovers
## Game Controls
- **Drag** - Rotate the polyhedron
- **Click faces** - Select faces (red highlight)
- **Hover** - Face highlighting (yellow) and info display
- **Rotate Globe**: Click and drag
- **Zoom**: Scroll or pinch (limited range)
- **Select Unit**: Click on your rover
- **Move**: Click Move → Click adjacent face twice
- **Shoot**: Click Shoot → Click enemy within range
- **Fortify**: Click Fortify → Click empty adjacent space
## Technical Features
- Built with Three.js and TypeScript
- Mathematical precision (60 vertices, 150 edges)
- Mouse rotation controls
- Face selection and highlighting
- Click interactions for game logic
- TypeScript for type safety