Skip to content

Commit 8467f39

Browse files
AugustoLclaude
andcommitted
chore: Switch deployment from Vercel to GitHub Pages
- Add static export config and basePath to next.config.mjs - Remove @vercel/analytics dependency and usage - Add GitHub Actions workflow for GH Pages deployment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 51f8374 commit 8467f39

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
version: latest
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Build
36+
run: pnpm build
37+
env:
38+
# Remove this env var (and the basePath in next.config.mjs) if using a custom domain.
39+
NEXT_PUBLIC_BASE_PATH: /docs
40+
41+
- uses: actions/configure-pages@v5
42+
43+
- uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: out
46+
47+
deploy:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

app/layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Metadata } from 'next'
2-
import { Analytics } from '@vercel/analytics/next'
32
import './globals.css'
43

54
export const metadata: Metadata = {
@@ -23,7 +22,6 @@ export default function RootLayout({
2322
<html lang="en">
2423
<body className="font-sans antialiased">
2524
{children}
26-
<Analytics />
2725
</body>
2826
</html>
2927
)

next.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3+
output: 'export',
4+
// basePath is required when deploying to GitHub Pages at openscan-explorer.github.io/docs.
5+
// Remove this if you configure a custom domain (e.g. docs.openscan.io).
6+
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
37
typescript: {
48
ignoreBuildErrors: true,
59
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"dependencies": {
1212
"@hookform/resolvers": "^3.9.1",
13-
"@vercel/analytics": "1.6.1",
1413
"@radix-ui/react-accordion": "1.2.12",
1514
"@radix-ui/react-alert-dialog": "1.1.15",
1615
"@radix-ui/react-aspect-ratio": "1.1.8",

0 commit comments

Comments
 (0)