Skip to content

Commit 911cd9e

Browse files
committed
feat: publish to github pages
1 parent 313a305 commit 911cd9e

File tree

6 files changed

+58
-5
lines changed

6 files changed

+58
-5
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
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" />
8+
<meta name="google-site-verification" content="0K_4YI_cVN1OmXDCAid5ReK3zOBKivJl5oeWoiDQGS8" />
99
<meta name="description"
1010
content="Binary Timer Countdown - A Unique Way to Track Time in Binary!
1111
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!">
1212
<meta name="author" content="kungfux">
13-
<link rel="canonical" href="https://binarytimer.surge.sh/">
13+
<link rel="canonical" href="https://kungfux.github.io/binarytimer/">
1414
<title>Binary Timer</title>
1515
</head>
1616
<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>

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)