Skip to content

Commit 45acdd0

Browse files
committed
Update homepage link in package.json and README.md to reflect new GitHub Pages URL. Configure Vite for GitHub Pages deployment with updated build settings.
1 parent 6ee2b20 commit 45acdd0

File tree

4 files changed

+81
-2
lines changed

4 files changed

+81
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '18'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build
34+
run: npm run build
35+
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v4
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: './dist'
43+
44+
deploy:
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
runs-on: ubuntu-latest
49+
needs: build
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Pixel2CPP is a browser-based pixel art editor designed for Arduino and embedded display development. Draw your sprites, icons, and graphics, then export them as optimized C++ arrays ready to use with popular display libraries like Adafruit_GFX.
99

10-
🎮 **[Try it live](https://coderandom.com/pixel-to-cpp)** | 📖 **[Documentation](#usage-guide)** | 🐛 **[Report Issues](https://github.com/CodeRandomMC/pixel-to-cpp/issues)**
10+
🎮 **[Try it live](https://coderandommc.github.io/pixel-to-cpp)** | 📖 **[Documentation](#usage-guide)** | 🐛 **[Report Issues](https://github.com/CodeRandomMC/pixel-to-cpp/issues)**
1111

1212
![Pixel2CPP Screenshot](https://raw.githubusercontent.com/CodeRandomMC/pixel-to-cpp/main/screenshot.png)
1313

@@ -44,8 +44,28 @@ npm install
4444
npm run dev
4545

4646
# Open http://localhost:5173 in your browser
47+
48+
### Building for Production
49+
```bash
50+
# Build the project
51+
npm run build
52+
53+
# Preview the production build
54+
npm run preview
4755
```
4856

57+
### Deploying to GitHub Pages
58+
59+
This project is configured to automatically deploy to GitHub Pages when you push to the main branch. The deployment is handled by GitHub Actions.
60+
61+
**Manual Deployment:**
62+
1. Build the project: `npm run build`
63+
2. The built files will be in the `dist/` directory
64+
3. Configure GitHub Pages in your repository settings to serve from the `dist/` directory
65+
4. Or use the GitHub Actions workflow (recommended)
66+
67+
**GitHub Pages URL:** `https://coderandommc.github.io/pixel-to-cpp`
68+
4969
## 📖 Usage Guide
5070

5171
### 1. Setting Up Your Canvas

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "https://github.com/CodeRandomMC/pixel-to-cpp.git"
1212
},
13-
"homepage": "https://coderandom.com/pixel-to-cpp",
13+
"homepage": "https://coderandommc.github.io/pixel-to-cpp",
1414
"scripts": {
1515
"dev": "vite",
1616
"build": "vite build",

vite.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ import react from '@vitejs/plugin-react'
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7+
base: '/pixel-to-cpp/', // Set the base path for GitHub Pages
8+
build: {
9+
outDir: 'dist',
10+
assetsDir: 'assets',
11+
sourcemap: false,
12+
},
713
})

0 commit comments

Comments
 (0)