Skip to content

Commit 5a2b2b7

Browse files
committed
feat: publish to github pages
1 parent 313a305 commit 5a2b2b7

File tree

7 files changed

+69
-7
lines changed

7 files changed

+69
-7
lines changed

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish
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+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: 22.x
31+
cache: "npm"
32+
33+
- name: Restore
34+
run: npm ci
35+
36+
- name: Test
37+
run: npm run lint
38+
39+
- name: Build
40+
run: npm run build
41+
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v5
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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Binary Timer is a simple countdown timer that counts down in binary.
44

5-
Available online at [https://binarytimer.surge.sh](https://binarytimer.surge.sh)
5+
Available online at [https://kungfux.github.io/binarytimer](https://kungfux.github.io/binarytimer)
66

77
![screenshot](public/screenshot-wide.png)
88

index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
<meta charset="UTF-8" />
66
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<meta name="google-site-verification" content="DuybeW01gi4SeBHy7YyqfLYOfQ82DNm-heBEhjprUVc" />
98
<meta name="description"
109
content="Binary Timer Countdown - A Unique Way to Track Time in Binary!
1110
This interactive tool lets you visualize countdowns in binary, making it perfect for tech enthusiasts, programmers, and learners. Whether you're exploring binary concepts, teaching coding fundamentals, or simply fascinated by unique timers, our binary countdown tool combines education and functionality. Learn, teach, and enjoy the simplicity of binary time tracking today!">
1211
<meta name="author" content="kungfux">
13-
<link rel="canonical" href="https://binarytimer.surge.sh/">
12+
<link rel="canonical" href="https://kungfux.github.io/binarytimer/">
1413
<title>Binary Timer</title>
1514
</head>
1615
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ZX3L2JT8RY"></script>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
6+
"homepage": "https://kungfux.github.io/binarytimer",
67
"scripts": {
78
"dev": "vite",
89
"build": "tsc -b && vite build",
9-
"publish": "surge ./dist binarytimer.surge.sh",
1010
"lint": "eslint .",
1111
"preview": "vite preview"
1212
},

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import App from "./App.tsx";
77

88
createRoot(document.getElementById("root")!).render(
99
<StrictMode>
10-
<BrowserRouter>
10+
<BrowserRouter basename="/binarytimer">
1111
<App />
1212
</BrowserRouter>
1313
</StrictMode>

src/pages/TimerCountdown.page.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,18 @@ function TimerCountdown() {
106106

107107
return (
108108
<>
109-
<audio id="bee" src="bee.mp3" preload="auto" muted={isMuted} />
110-
<audio id="doo" src="doo.mp3" preload="auto" muted={isMuted} />
109+
<audio
110+
id="bee"
111+
src="/binarytimer/bee.mp3"
112+
preload="auto"
113+
muted={isMuted}
114+
/>
115+
<audio
116+
id="doo"
117+
src="/binarytimer/doo.mp3"
118+
preload="auto"
119+
muted={isMuted}
120+
/>
111121
<div className="flex flex-col items-center justify-center text-center">
112122
<div className="flex flex-col items-center justify-center text-center">
113123
<h1 className="text-5xl uppercase mb-8">Please stand by</h1>

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react'
33
import { VitePWA } from 'vite-plugin-pwa';
44

55
export default defineConfig({
6+
base: '/binarytimer/',
67
plugins: [react(),
78
VitePWA({
89
registerType: 'autoUpdate',

0 commit comments

Comments
 (0)