From 09c065b0e58dd7413f88a68f681ff15feb676024 Mon Sep 17 00:00:00 2001 From: pmckinney-codat Date: Mon, 27 Jul 2026 12:07:06 +0100 Subject: [PATCH 1/4] EXP-1609: Deploy to GitHub Pages via Actions; remove vercel-analytics - deploy.yml: build on main + publish to GitHub Pages (Node 24, npm ci with NPM_TOKEN against the ADO feed, build env vars via repo secrets/variables) - pr.yml: build-only PR check (replaces Vercel preview deployments) - static/CNAME for docs.codat.io - Remove @docusaurus/plugin-vercel-analytics plugin + dependency (lockfile edited by hand; npm ci in CI validates it) - vercel.json intentionally untouched: Vercel still serves prod from main until decommission, and it carries the live CORS headers Co-Authored-By: Claude Fable 5 --- .github/workflows/deploy.yml | 56 +++++++++++++++++++++++++++++++++ .github/workflows/pr.yml | 30 ++++++++++++++++++ docusaurus.config.js | 2 -- package-lock.json | 61 ------------------------------------ package.json | 1 - static/CNAME | 1 + 6 files changed, 87 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/pr.yml create mode 100644 static/CNAME diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..8ec5eff07 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm + + - name: Install dependencies + run: npm ci + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Build site + run: npm run build + env: + ZENDESK_KEY: ${{ secrets.ZENDESK_KEY }} + AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} + GTM_ID: ${{ vars.GTM_ID }} + FEATURE_DEV_FLAG: ${{ vars.FEATURE_DEV_FLAG }} + FEATURE_NEW_PRODUCTS_FLAG: ${{ vars.FEATURE_NEW_PRODUCTS_FLAG }} + + - uses: actions/configure-pages@v6 + + - uses: actions/upload-pages-artifact@v5 + with: + path: build + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..53ae09f0b --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,30 @@ +name: PR build + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm + + # The ADO registry in .npmrc requires auth even to install, so PR + # builds need NPM_TOKEN too (fork PRs don't get secrets and will fail) + - name: Install dependencies + run: npm ci + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Build site + run: npm run build + env: + # plugin-google-gtag requires a trackingID, so PR builds need it too + GTM_ID: ${{ vars.GTM_ID }} + FEATURE_DEV_FLAG: ${{ vars.FEATURE_DEV_FLAG }} + FEATURE_NEW_PRODUCTS_FLAG: ${{ vars.FEATURE_NEW_PRODUCTS_FLAG }} diff --git a/docusaurus.config.js b/docusaurus.config.js index b369a7ce3..dd466c30f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -262,8 +262,6 @@ const config = { anonymizeIP: true, }, ], - - "vercel-analytics", ], themes: ["@docusaurus/theme-mermaid", "docusaurus-theme-search-typesense"], diff --git a/package-lock.json b/package-lock.json index 8cc245172..096666830 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "@codat/sdk-link-types": "1.10.1", "@docusaurus/core": "3.9.2", "@docusaurus/plugin-client-redirects": "3.9.2", - "@docusaurus/plugin-vercel-analytics": "3.9.2", "@docusaurus/preset-classic": "3.9.2", "@docusaurus/theme-live-codeblock": "3.9.2", "@docusaurus/theme-mermaid": "3.9.2", @@ -4639,28 +4638,6 @@ "react-dom": "^18.0.0 || ^19.0.0" } }, - "node_modules/@docusaurus/plugin-vercel-analytics": { - "version": "3.9.2", - "resolved": "https://pkgs.dev.azure.com/codat/Codat/_packaging/codat-npm/npm/registry/@docusaurus/plugin-vercel-analytics/-/plugin-vercel-analytics-3.9.2.tgz", - "integrity": "sha1-YatIFDyr6yBWdjdWW/e9kGMUoMo=", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.9.2", - "@docusaurus/logger": "3.9.2", - "@docusaurus/types": "3.9.2", - "@docusaurus/utils": "3.9.2", - "@docusaurus/utils-validation": "3.9.2", - "@vercel/analytics": "^1.1.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=20.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, "node_modules/@docusaurus/preset-classic": { "version": "3.9.2", "resolved": "https://pkgs.dev.azure.com/codat/Codat/_packaging/codat-npm/npm/registry/@docusaurus/preset-classic/-/preset-classic-3.9.2.tgz", @@ -9075,44 +9052,6 @@ "integrity": "sha1-0Gu7OE689sUF/eHD0O1N3/4Kr/g=", "license": "ISC" }, - "node_modules/@vercel/analytics": { - "version": "1.6.1", - "resolved": "https://pkgs.dev.azure.com/codat/Codat/_packaging/codat-npm/npm/registry/@vercel/analytics/-/analytics-1.6.1.tgz", - "integrity": "sha1-tOFtr0Rc9s02WpHkPYbp5bNCjdw=", - "license": "MPL-2.0", - "peerDependencies": { - "@remix-run/react": "^2", - "@sveltejs/kit": "^1 || ^2", - "next": ">= 13", - "react": "^18 || ^19 || ^19.0.0-rc", - "svelte": ">= 4", - "vue": "^3", - "vue-router": "^4" - }, - "peerDependenciesMeta": { - "@remix-run/react": { - "optional": true - }, - "@sveltejs/kit": { - "optional": true - }, - "next": { - "optional": true - }, - "react": { - "optional": true - }, - "svelte": { - "optional": true - }, - "vue": { - "optional": true - }, - "vue-router": { - "optional": true - } - } - }, "node_modules/@vercel/oidc": { "version": "3.0.5", "resolved": "https://pkgs.dev.azure.com/codat/Codat/_packaging/codat-npm/npm/registry/@vercel/oidc/-/oidc-3.0.5.tgz", diff --git a/package.json b/package.json index 3bfe3df9f..f30199def 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "@codat/sdk-link-types": "1.10.1", "@docusaurus/core": "3.9.2", "@docusaurus/plugin-client-redirects": "3.9.2", - "@docusaurus/plugin-vercel-analytics": "3.9.2", "@docusaurus/preset-classic": "3.9.2", "@docusaurus/theme-live-codeblock": "3.9.2", "@docusaurus/theme-mermaid": "3.9.2", diff --git a/static/CNAME b/static/CNAME new file mode 100644 index 000000000..45562a98d --- /dev/null +++ b/static/CNAME @@ -0,0 +1 @@ +docs.codat.io From dfba9ad646d9af62a4c40b5ffaaf95a10def2169 Mon Sep 17 00:00:00 2001 From: pmckinney-codat Date: Mon, 27 Jul 2026 13:11:58 +0100 Subject: [PATCH 2/4] EXP-1609: Read build env vars from secrets (values were added as secrets, not variables) Co-Authored-By: Claude Fable 5 --- .github/workflows/deploy.yml | 6 +++--- .github/workflows/pr.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ec5eff07..01632927a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,9 +35,9 @@ jobs: env: ZENDESK_KEY: ${{ secrets.ZENDESK_KEY }} AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} - GTM_ID: ${{ vars.GTM_ID }} - FEATURE_DEV_FLAG: ${{ vars.FEATURE_DEV_FLAG }} - FEATURE_NEW_PRODUCTS_FLAG: ${{ vars.FEATURE_NEW_PRODUCTS_FLAG }} + GTM_ID: ${{ secrets.GTM_ID }} + FEATURE_DEV_FLAG: ${{ secrets.FEATURE_DEV_FLAG }} + FEATURE_NEW_PRODUCTS_FLAG: ${{ secrets.FEATURE_NEW_PRODUCTS_FLAG }} - uses: actions/configure-pages@v6 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 53ae09f0b..bb5950ae5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,6 +25,6 @@ jobs: run: npm run build env: # plugin-google-gtag requires a trackingID, so PR builds need it too - GTM_ID: ${{ vars.GTM_ID }} - FEATURE_DEV_FLAG: ${{ vars.FEATURE_DEV_FLAG }} - FEATURE_NEW_PRODUCTS_FLAG: ${{ vars.FEATURE_NEW_PRODUCTS_FLAG }} + GTM_ID: ${{ secrets.GTM_ID }} + FEATURE_DEV_FLAG: ${{ secrets.FEATURE_DEV_FLAG }} + FEATURE_NEW_PRODUCTS_FLAG: ${{ secrets.FEATURE_NEW_PRODUCTS_FLAG }} From cb9c6cd18a083ef7bfad7d7d106b52c60beeeeeb Mon Sep 17 00:00:00 2001 From: pmckinney-codat Date: Mon, 27 Jul 2026 13:16:51 +0100 Subject: [PATCH 3/4] EXP-1609: Remove @vercel/analytics import from swizzled NavbarItem The Sign-in click is already tracked via Amplitude; the Vercel track() call was the only remaining usage and broke the build (and the Vercel preview) once the dependency was removed. Co-Authored-By: Claude Fable 5 --- src/theme/NavbarItem/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/theme/NavbarItem/index.tsx b/src/theme/NavbarItem/index.tsx index f09a73513..8b910701d 100644 --- a/src/theme/NavbarItem/index.tsx +++ b/src/theme/NavbarItem/index.tsx @@ -4,7 +4,6 @@ import NavbarIconLink from "@theme/NavbarItem/NavbarIconLink"; import NavbarSeparator from "@theme/NavbarItem/NavbarSeparator"; import NavbarCta from "@theme/NavbarItem/NavbarCta"; -import { track } from "@vercel/analytics"; import { trackEvent } from "../../utils/amplitude"; const CustomNavbarItemComponents = { @@ -18,7 +17,6 @@ export default function NavbarItem(props) { const onTrack = () => { if (props.label === "Sign in") { - track("Sign in"); trackEvent("Navigation Click", { element: "Sign in", type: "navbar_cta", From 7dcb504ee45c5770078c6c4b7b681bd6144c5202 Mon Sep 17 00:00:00 2001 From: pmckinney-codat Date: Mon, 27 Jul 2026 13:18:07 +0100 Subject: [PATCH 4/4] EXP-1609: Read non-secret build config from repo variables GTM_ID and the feature flags are public values; vars keep them visible in the UI and unmasked in logs. Co-Authored-By: Claude Fable 5 --- .github/workflows/deploy.yml | 6 +++--- .github/workflows/pr.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 01632927a..8ec5eff07 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,9 +35,9 @@ jobs: env: ZENDESK_KEY: ${{ secrets.ZENDESK_KEY }} AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} - GTM_ID: ${{ secrets.GTM_ID }} - FEATURE_DEV_FLAG: ${{ secrets.FEATURE_DEV_FLAG }} - FEATURE_NEW_PRODUCTS_FLAG: ${{ secrets.FEATURE_NEW_PRODUCTS_FLAG }} + GTM_ID: ${{ vars.GTM_ID }} + FEATURE_DEV_FLAG: ${{ vars.FEATURE_DEV_FLAG }} + FEATURE_NEW_PRODUCTS_FLAG: ${{ vars.FEATURE_NEW_PRODUCTS_FLAG }} - uses: actions/configure-pages@v6 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bb5950ae5..53ae09f0b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,6 +25,6 @@ jobs: run: npm run build env: # plugin-google-gtag requires a trackingID, so PR builds need it too - GTM_ID: ${{ secrets.GTM_ID }} - FEATURE_DEV_FLAG: ${{ secrets.FEATURE_DEV_FLAG }} - FEATURE_NEW_PRODUCTS_FLAG: ${{ secrets.FEATURE_NEW_PRODUCTS_FLAG }} + GTM_ID: ${{ vars.GTM_ID }} + FEATURE_DEV_FLAG: ${{ vars.FEATURE_DEV_FLAG }} + FEATURE_NEW_PRODUCTS_FLAG: ${{ vars.FEATURE_NEW_PRODUCTS_FLAG }}