Skip to content

Commit c34c2e0

Browse files
committed
ci: redirect GitHub Pages and Netlify to canonical Cloudflare domain
GitHub Pages and Netlify are now redirect-only stubs (no app build); both 301/JS-redirect to https://torena-sim.pages.dev, preserving path/query/hash. Only merge/run after Cloudflare Pages is verified live.
1 parent fda2e54 commit c34c2e0

3 files changed

Lines changed: 74 additions & 89 deletions

File tree

.github/workflows/deploy-netlify.yml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,48 @@
1-
name: Deploy to Netlify
1+
name: Deploy Netlify redirect
2+
3+
# Netlify is no longer a real deploy target — it only 301s legacy
4+
# *.netlify.app traffic to the canonical Cloudflare Pages domain
5+
# (https://torena-sim.pages.dev). This publishes just the redirect rules,
6+
# so there is no app build (no Bun/Rust/wasm) here.
27

38
on:
4-
# Run after Versioning so semantic-release has created the release tag before
5-
# changelog:generate reads git history for the in-app changelog.
6-
workflow_run:
7-
workflows: [Versioning]
8-
types: [completed]
9-
branches: [main]
109
workflow_dispatch:
10+
push:
11+
branches: [main]
12+
paths:
13+
- netlify.toml
14+
- .github/workflows/deploy-netlify.yml
1115

1216
concurrency:
1317
group: netlify
1418
cancel-in-progress: true
1519

1620
jobs:
1721
deploy:
18-
name: Deploy to Netlify
22+
name: Publish Netlify redirect
1923
runs-on: ubuntu-latest
20-
env:
21-
VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
22-
VITE_PUBLIC_POSTHOG_HOST: ${{ vars.VITE_PUBLIC_POSTHOG_HOST }}
23-
VITE_SITE_URL: https://sundays-shadow.netlify.app
24-
VITE_SUGGESTION_WORKER_URL: ${{ vars.VITE_SUGGESTION_WORKER_URL }}
25-
VITE_TURNSTILE_SITE_KEY: ${{ vars.VITE_TURNSTILE_SITE_KEY }}
2624

2725
steps:
2826
- name: Checkout code
2927
uses: actions/checkout@v6.0.2
30-
with:
31-
fetch-depth: 0
32-
33-
- name: Setup Bun
34-
uses: oven-sh/setup-bun@v2
35-
36-
- name: Install dependencies
37-
run: bun install --frozen-lockfile
38-
39-
- name: Generate changelog for build
40-
run: bun run changelog:generate
41-
42-
- name: Build app
43-
run: bun run build
44-
45-
- name: Copy netlify.toml to dist
46-
run: cp netlify.toml dist/
4728

48-
- name: Deploy to Netlify
29+
- name: Assemble redirect publish dir
30+
run: |
31+
mkdir -p netlify-redirect
32+
cp netlify.toml netlify-redirect/
33+
cat > netlify-redirect/index.html <<'HTML'
34+
<!doctype html>
35+
<meta charset="utf-8">
36+
<meta http-equiv="refresh" content="0; url=https://torena-sim.pages.dev/">
37+
<link rel="canonical" href="https://torena-sim.pages.dev/">
38+
<title>Moved to torena-sim.pages.dev</title>
39+
<p>This app has moved to <a href="https://torena-sim.pages.dev">torena-sim.pages.dev</a>.</p>
40+
HTML
41+
42+
- name: Deploy redirect to Netlify
4943
uses: nwtgck/actions-netlify@v3
5044
with:
51-
publish-dir: ./dist
45+
publish-dir: ./netlify-redirect
5246
production-deploy: true
5347
env:
5448
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

.github/workflows/deploy-pages.yml

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy GitHub Pages redirect
2+
3+
# GitHub Pages is no longer a real deploy target — it only redirects to the
4+
# canonical Cloudflare Pages domain (https://torena-sim.pages.dev). This
5+
# publishes a tiny static redirect, so there is no app build here.
26

37
on:
4-
# Run after Versioning so semantic-release has created the release tag before
5-
# changelog:generate reads git history for the in-app changelog.
6-
workflow_run:
7-
workflows: [Versioning]
8-
types: [completed]
9-
branches: [main]
108
workflow_dispatch:
9+
push:
10+
branches: [main]
11+
paths:
12+
- .github/workflows/deploy-pages.yml
1113

1214
permissions:
1315
contents: read
@@ -20,65 +22,51 @@ concurrency:
2022

2123
jobs:
2224
build:
23-
name: Build site
25+
name: Build redirect
2426
runs-on: ubuntu-latest
25-
env:
26-
VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
27-
VITE_PUBLIC_POSTHOG_HOST: ${{ vars.VITE_PUBLIC_POSTHOG_HOST }}
28-
VITE_BASE_PATH: ${{ vars.VITE_BASE_PATH }}
29-
VITE_SUGGESTION_WORKER_URL: ${{ vars.VITE_SUGGESTION_WORKER_URL }}
30-
VITE_TURNSTILE_SITE_KEY: ${{ vars.VITE_TURNSTILE_SITE_KEY }}
3127

3228
steps:
33-
- name: Checkout code
34-
uses: actions/checkout@v6.0.2
35-
with:
36-
fetch-depth: 0
37-
38-
- name: Setup Bun
39-
uses: oven-sh/setup-bun@v2
40-
41-
- name: Setup Rust toolchain (wasm32)
42-
uses: dtolnay/rust-toolchain@stable
43-
with:
44-
targets: wasm32-unknown-unknown
45-
46-
- name: Cache Rust build
47-
uses: swatinem/rust-cache@v2
48-
with:
49-
workspaces: packages
50-
51-
- name: Install wasm-pack
52-
uses: jetli/wasm-pack-action@v0.4.0
53-
5429
- name: Configure GitHub Pages
5530
uses: actions/configure-pages@v6
5631

57-
- name: Install dependencies
58-
run: bun install --frozen-lockfile
59-
60-
- name: Generate changelog for build
61-
run: bun run changelog:generate
62-
63-
- name: Run type check
64-
run: bun run typecheck
65-
66-
- name: Run linter
67-
run: bun run lint
68-
69-
- name: Build app
70-
run: bun run build
71-
72-
- name: Create 404.html for SPA routing
73-
run: cp dist/index.html dist/404.html
32+
- name: Generate redirect site
33+
run: |
34+
mkdir -p dist
35+
cat > dist/index.html <<'HTML'
36+
<!doctype html>
37+
<html lang="en">
38+
<head>
39+
<meta charset="utf-8">
40+
<meta name="robots" content="noindex">
41+
<title>Moved to torena-sim.pages.dev</title>
42+
<link rel="canonical" href="https://torena-sim.pages.dev/">
43+
<script>
44+
(function () {
45+
var base = "/umalator-global";
46+
var path = location.pathname.indexOf(base) === 0
47+
? location.pathname.slice(base.length)
48+
: location.pathname;
49+
location.replace(
50+
"https://torena-sim.pages.dev" + (path || "/") + location.search + location.hash
51+
);
52+
})();
53+
</script>
54+
<meta http-equiv="refresh" content="0; url=https://torena-sim.pages.dev/">
55+
</head>
56+
<body>
57+
<p>This app has moved to <a href="https://torena-sim.pages.dev">torena-sim.pages.dev</a>. Redirecting…</p>
58+
</body>
59+
</html>
60+
HTML
61+
cp dist/index.html dist/404.html
7462
7563
- name: Upload GitHub Pages artifact
7664
uses: actions/upload-pages-artifact@v5
7765
with:
7866
path: ./dist
7967

8068
deploy:
81-
name: Deploy site
69+
name: Deploy redirect
8270
needs: build
8371
runs-on: ubuntu-latest
8472
environment:

netlify.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# Netlify is a redirect-only stub. The canonical app lives on Cloudflare Pages
2+
# (https://torena-sim.pages.dev). This 301s any legacy *.netlify.app traffic.
13
[[redirects]]
2-
from = "/*"
3-
to = "/index.html"
4-
status = 200
4+
from = "/*"
5+
to = "https://torena-sim.pages.dev/:splat"
6+
status = 301
7+
force = true

0 commit comments

Comments
 (0)