Skip to content

Commit 570e6ec

Browse files
aidmaxclaude
andcommitted
feat: add GitHub Pages deployment workflow
Add deploy-pages.yml that builds with VITE_BASE_PATH=/pedalnotes/ and deploys to GitHub Pages on every push to main. The S3 deploy workflow is unchanged. Add VITE_BASE_PATH support to vite.config.ts so the base path is configurable per environment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 38ef439 commit 570e6ec

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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: true
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20.x'
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build
38+
run: npm run build
39+
env:
40+
VITE_BASE_PATH: '/pedalnotes/'
41+
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: dist
49+
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default defineConfig({
1010
plugins: [
1111
react(),
1212
],
13+
base: process.env.VITE_BASE_PATH ?? '/',
1314
resolve: {
1415
alias: {
1516
"@": path.resolve(__dirname, "client", "src"),

0 commit comments

Comments
 (0)