Skip to content

Commit 41c0add

Browse files
falkenhawkclaude
andcommitted
Add GitHub Pages deployment for examples
- Configure Vite base path for /scrubtime/ - Add GitHub Actions workflow for automated deployment - Restore meaningful example configurations - Fix slider label edge alignment (+1px on right) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bbef56f commit 41c0add

3 files changed

Lines changed: 60 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: pnpm/action-setup@v2
24+
with:
25+
version: 8
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: pnpm
31+
cache-dependency-path: example/pnpm-lock.yaml
32+
33+
- name: Build library
34+
run: |
35+
npm install
36+
npm run build
37+
38+
- name: Build example
39+
working-directory: example
40+
run: |
41+
pnpm install
42+
pnpm build
43+
44+
- uses: actions/configure-pages@v4
45+
46+
- uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: example/dist
49+
50+
deploy:
51+
needs: build
52+
runs-on: ubuntu-latest
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
steps:
57+
- uses: actions/deploy-pages@v4
58+
id: deployment

example/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ import react from '@vitejs/plugin-react';
33

44
export default defineConfig({
55
plugins: [react()],
6+
base: '/scrubtime/',
67
});

src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
margin-top: 0.25rem;
165165
/* Inset to match thumb travel range */
166166
margin-left: calc(var(--thumb-width) / 2);
167-
margin-right: calc(var(--thumb-width) / 2);
167+
margin-right: calc(var(--thumb-width) / 2 + 1px);
168168
}
169169

170170
.scrubtime-slider-labels span {

0 commit comments

Comments
 (0)