Skip to content

Commit ee9bbea

Browse files
committed
feat(deploy): add pages and ghcr publish workflows
1 parent 11e280f commit ee9bbea

11 files changed

Lines changed: 135 additions & 18 deletions

File tree

.github/workflows/pages.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
pages: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
version: 10.33.1
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 22
29+
cache: pnpm
30+
- run: pnpm install --frozen-lockfile=false
31+
- run: pnpm --filter @csvshape/web build
32+
env:
33+
VITE_APP_BASE_PATH: /${{ github.event.repository.name }}/
34+
VITE_PUBLIC_SITE_ORIGIN: https://${{ github.repository_owner }}.github.io
35+
- uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: packages/web/dist
38+
39+
deploy:
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
needs: build
44+
runs-on: ubuntu-latest
45+
steps:
46+
- id: deployment
47+
uses: actions/deploy-pages@v4

.github/workflows/worker-image.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Worker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
images: ghcr.io/${{ github.repository_owner }}/csvshape-worker
22+
tags: |
23+
type=ref,event=branch
24+
type=sha,prefix=sha-
25+
type=raw,value=latest,enable={{is_default_branch}}
26+
- uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
- uses: docker/build-push-action@v6
32+
with:
33+
context: .
34+
file: apps/worker/Dockerfile
35+
labels: ${{ steps.meta.outputs.labels }}
36+
push: true
37+
tags: ${{ steps.meta.outputs.tags }}

packages/web/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VITE_APP_BASE_PATH=/
2+
VITE_PUBLIC_SITE_ORIGIN=http://localhost:4173

packages/web/csv-filter-online/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
name="description"
77
content="Filter CSV online with browser-side verb chains, dialect sniffing, previews, and replayable transformations."
88
/>
9+
<link rel="icon" type="image/svg+xml" href="%VITE_APP_BASE_PATH%favicon.svg" />
10+
<link rel="canonical" href="%VITE_PUBLIC_SITE_ORIGIN%%VITE_APP_BASE_PATH%csv-filter-online/" />
911
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1012
<title>CSV Filter Online | CSVShape</title>
1113
</head>

packages/web/csv-join-online/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
name="description"
77
content="Join CSV online with browser-side file intake, JSONL bridge queries, grouped stats, and replayable chain URLs."
88
/>
9+
<link rel="icon" type="image/svg+xml" href="%VITE_APP_BASE_PATH%favicon.svg" />
10+
<link rel="canonical" href="%VITE_PUBLIC_SITE_ORIGIN%%VITE_APP_BASE_PATH%csv-join-online/" />
911
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1012
<title>CSV Join Online | CSVShape</title>
1113
</head>

packages/web/csv-pivot-online/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
name="description"
77
content="Pivot CSV online with reshape controls for longer, wider, explode, and grouped aggregation workflows."
88
/>
9+
<link rel="icon" type="image/svg+xml" href="%VITE_APP_BASE_PATH%favicon.svg" />
10+
<link rel="canonical" href="%VITE_PUBLIC_SITE_ORIGIN%%VITE_APP_BASE_PATH%csv-pivot-online/" />
911
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1012
<title>CSV Pivot Online | CSVShape</title>
1113
</head>

packages/web/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
name="description"
77
content="Stream-process CSV, TSV, NDJSON and JSONL in your browser with Miller-style verb chains, joins, pivots and dialect sniffing."
88
/>
9-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
10-
<link rel="canonical" href="https://csvshape.example.com/" />
9+
<link rel="icon" type="image/svg+xml" href="%VITE_APP_BASE_PATH%favicon.svg" />
10+
<link rel="canonical" href="%VITE_PUBLIC_SITE_ORIGIN%%VITE_APP_BASE_PATH%" />
1111
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1212
<meta name="theme-color" content="#0f172a" />
1313
<title>CSVShape</title>

packages/web/jsonl-tools/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
name="description"
77
content="Use JSONL tools online with jq-style filters, previews, CSV joins, and worker fallback for large files."
88
/>
9+
<link rel="icon" type="image/svg+xml" href="%VITE_APP_BASE_PATH%favicon.svg" />
10+
<link rel="canonical" href="%VITE_PUBLIC_SITE_ORIGIN%%VITE_APP_BASE_PATH%jsonl-tools/" />
911
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1012
<title>JSONL Tools | CSVShape</title>
1113
</head>

packages/web/miller-online/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
name="description"
77
content="Run Miller-style verb chains online with cat, filter, put, cut, join, sort, stats, reorder, nest, and unnest."
88
/>
9+
<link rel="icon" type="image/svg+xml" href="%VITE_APP_BASE_PATH%favicon.svg" />
10+
<link rel="canonical" href="%VITE_PUBLIC_SITE_ORIGIN%%VITE_APP_BASE_PATH%miller-online/" />
911
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1012
<title>Miller Online | CSVShape</title>
1113
</head>

packages/web/src/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ export function App() {
249249
document.title = routeSeo.title;
250250
const description = document.querySelector('meta[name="description"]');
251251
description?.setAttribute('content', routeSeo.description);
252+
const canonicalUrl = new URL(window.location.pathname, window.location.origin);
253+
const canonical = document.querySelector<HTMLLinkElement>('link[rel="canonical"]');
254+
255+
if (canonical) {
256+
canonical.href = canonicalUrl.toString();
257+
}
252258
}, [routeSeo]);
253259

254260
useEffect(() => {

0 commit comments

Comments
 (0)