Skip to content

Commit f31e901

Browse files
Promote Astro migration to production (shared layout, pre-rendered data, build via Actions) (#2)
* Quick wins: add .gitattributes, load Inter site-wide, homepage OG/Twitter tags Quick wins: add .gitattributes, load Inter site-wide, homepage OG/Twitter tags * Add Open Graph/Twitter social tags to main pages; remove stray duplicate og:url tags Add Open Graph/Twitter social tags to main pages; remove stray duplicate og:url tags * Add social tags to main pages + hostname-keyed QA noindex; remove stray og:url duplicates Add social tags to main pages + hostname-keyed QA noindex; remove stray og:url duplicates * Add Open Graph/Twitter tags to all remaining pages (deeper + docs); remove stray duplicate og:url Add Open Graph/Twitter tags to all remaining pages (deeper + docs); remove stray duplicate og:url * Astro Phase 0: scaffold + build-check workflow (no deploy) Astro Phase 0: scaffold + build-check workflow (no deploy) * Astro Phase 1a: deploy pipeline with legacy overlay (zero visual change) Astro Phase 1a: deploy pipeline with legacy overlay (zero visual change) * Astro Phase 1b: shared BaseLayout + homepage on Astro Astro Phase 1b: shared BaseLayout + homepage on Astro * Fix Astro base path join (trailing slash) for nav/assets Fix Astro base path join (trailing slash) for nav/assets * Astro Phase 2: convert platform, methodology, contact, licensing to shared layout Astro Phase 2: convert platform, methodology, contact, licensing to shared layout * Astro Phase 2: convert 5 intent guides to shared layout * Astro Phase 2: convert news + docs to shared layout (unified footer) * Astro Phase 2: convert all 16 docs sub-pages (schema + dynamic docs route) Astro Phase 2: convert all 16 docs sub-pages (schema + dynamic docs route) * Astro Phase 3: pre-render country aggregate from JSON (+ shared format lib) Astro Phase 3: pre-render country aggregate from JSON (+ shared format lib) * Astro Phase 3: pre-render asn + rir aggregate pages Astro Phase 3: pre-render asn + rir aggregate pages * Astro Phase 3 fix: load JSON via direct imports so pre-rendered data populates Astro Phase 3 fix: load JSON via direct imports so pre-rendered data populates * Astro fix: build.format 'preserve' so folder index pages output to /folder/index.html Astro fix: build.format 'preserve' so folder index pages output to /folder/index.html * Astro Phase 3: pre-render coverage data (table/metrics/leaders) + keep map island Astro Phase 3: pre-render coverage data (table/metrics/leaders) + keep map island * Astro Phase 3: pre-render homepage data (stats, release list, metrics, ASN/country lists) Astro Phase 3: pre-render homepage data (stats, release list, metrics, ASN/country lists) * Astro Phase 4: shell-wrap reference-bogons, downloads, releases onto shared layout Astro Phase 4: shell-wrap reference-bogons, downloads, releases onto shared layout * Astro Phase 4: shell-wrap reference catalogs + per-month download indexes Astro Phase 4: shell-wrap reference catalogs + per-month download indexes * Astro: auto-detect current release month from releases.json Astro: auto-detect current release month from releases.json * Remove legacy HTML now generated by Astro + stale SEO backups Remove legacy HTML now generated by Astro + stale SEO backups * Make deploy workflow environment-aware (QA sub-path / PROD root Make deploy workflow environment-aware (QA sub-path / PROD root --------- Co-authored-by: SQLDevelop <sqldevelop@gmail.com>
1 parent 94ab1fc commit f31e901

90 files changed

Lines changed: 2138 additions & 8287 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Normalize line endings so editors / sync tools stop rewriting every file.
2+
# Text files are stored with LF in the repo and checked out with LF.
3+
* text=auto eol=lf
4+
5+
# Treat binary assets as binary (never line-ending normalized).
6+
*.png binary
7+
*.jpg binary
8+
*.jpeg binary
9+
*.gif binary
10+
*.ico binary
11+
*.webp binary
12+
*.woff binary
13+
*.woff2 binary
14+
*.pdf binary
15+
*.zip binary
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build and deploy
2+
3+
# One workflow for both environments, selected by which repo it runs in:
4+
# - QA fork (geoiplocations/...) -> serves under the project sub-path, CNAME qa.geoiplocations.com
5+
# - Production (ProdIPData/...) -> serves at the root domain, CNAME geoiplocations.com
6+
# It builds Astro, overlays any not-yet-migrated legacy files, writes the right
7+
# CNAME, and deploys to that repo's GitHub Pages.
8+
9+
on:
10+
push:
11+
branches: [Redesign, main]
12+
workflow_dispatch: {}
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
group: pages-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Build Astro site
39+
run: npm run build
40+
env:
41+
# Production serves at the root; the QA fork serves under the project sub-path.
42+
SITE_BASE: ${{ github.repository == 'ProdIPData/prodipdata.github.io' && '/' || '/prodipdata.github.io' }}
43+
44+
- name: Overlay legacy pages not yet migrated to Astro
45+
# --ignore-existing means Astro-built pages are NEVER overwritten by legacy
46+
# copies; legacy files only fill paths Astro hasn't produced yet.
47+
run: |
48+
rsync -a --ignore-existing \
49+
--exclude '.git' \
50+
--exclude '.github' \
51+
--exclude 'node_modules' \
52+
--exclude 'src' \
53+
--exclude 'dist' \
54+
--exclude 'public' \
55+
--exclude 'package.json' \
56+
--exclude 'package-lock.json' \
57+
--exclude 'astro.config.mjs' \
58+
--exclude '.gitignore' \
59+
--exclude 'CNAME' \
60+
--exclude '_seo_wave1_backup_20260416_135936' \
61+
./ ./dist/
62+
63+
- name: Set custom domain (per environment, never committed)
64+
run: |
65+
if [ "${{ github.repository }}" = "ProdIPData/prodipdata.github.io" ]; then
66+
echo 'geoiplocations.com' > ./dist/CNAME
67+
else
68+
echo 'qa.geoiplocations.com' > ./dist/CNAME
69+
fi
70+
71+
- name: Configure Pages
72+
uses: actions/configure-pages@v5
73+
74+
- name: Upload artifact
75+
uses: actions/upload-pages-artifact@v3
76+
with:
77+
path: ./dist
78+
79+
deploy:
80+
needs: build
81+
runs-on: ubuntu-latest
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
steps:
86+
- name: Deploy to GitHub Pages
87+
id: deployment
88+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Node / Astro build artifacts (never committed — the GitHub Action installs & builds)
2+
node_modules/
3+
dist/
4+
.astro/
5+
npm-debug.log*
6+
.DS_Store

_seo_wave1_backup_20260416_135936/coverage.html

Lines changed: 0 additions & 241 deletions
This file was deleted.

0 commit comments

Comments
 (0)