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/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", 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