Skip to content

Commit 4d53672

Browse files
vishrclaude
andcommitted
feat(docs): cut deploy over to the Astro site + preserve Google Analytics
deploy.yaml now builds and publishes site/ (Astro -> ./site/dist) instead of website/ (Docusaurus). Merging to master will make echo.labstack.com serve the new site on the next deploy. Rollback = revert this commit (website/ source remains in the repo). Also carry over Google Analytics (G-H19TMZLQFN, anonymize_ip) into the Astro site's head so tracking continues uninterrupted after cutover. Verified: site/ builds clean, GA present on every page, CNAME in dist, all 64 legacy /docs/* URLs redirect. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 578b414 commit 4d53672

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
push:
55
branches:
66
- master
7-
# Daily rebuild + manual trigger. Once the deploy targets the Astro site (at
8-
# cutover), this refreshes build-time data like the GitHub star count in
9-
# site/src/data/github.ts; until then it just redeploys the current site.
7+
# Daily rebuild + manual trigger — refreshes build-time data like the GitHub
8+
# star count in site/src/data/github.ts without a manual deploy.
109
schedule:
1110
- cron: '0 6 * * *'
1211
# Allow manual runs from the Actions tab.
@@ -22,14 +21,14 @@ jobs:
2221
with:
2322
node-version: 24
2423
cache: npm
25-
cache-dependency-path: website/package-lock.json
24+
cache-dependency-path: site/package-lock.json
2625

2726
- name: Install dependencies
2827
run: npm ci
29-
working-directory: website
28+
working-directory: site
3029
- name: Build website
3130
run: npm run build
32-
working-directory: website
31+
working-directory: site
3332
env:
3433
# Lifts the GitHub API rate limit for build-time stats fetches.
3534
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -41,7 +40,7 @@ jobs:
4140
with:
4241
github_token: ${{ secrets.GITHUB_TOKEN }}
4342
# Build output to publish to the `gh-pages` branch:
44-
publish_dir: ./website/build
43+
publish_dir: ./site/dist
4544
# The following lines assign commit authorship to the official
4645
# GH-Actions bot for deploys to `gh-pages` branch:
4746
# https://github.com/actions/checkout/issues/13#issuecomment-724415212

site/astro.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ export default defineConfig({
3131
PageTitle: './src/components/PageTitle.astro',
3232
},
3333
head: [
34+
// Google Analytics (carried over from the Docusaurus site, anonymized IP).
35+
{ tag: 'script', attrs: { async: true, src: 'https://www.googletagmanager.com/gtag/js?id=G-H19TMZLQFN' } },
36+
{
37+
tag: 'script',
38+
content:
39+
"window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-H19TMZLQFN',{anonymize_ip:true});",
40+
},
3441
// Dark-first: default new visitors to dark unless they've chosen otherwise.
3542
{
3643
tag: 'script',

0 commit comments

Comments
 (0)