Skip to content

Commit b8e7efc

Browse files
committed
feat: add Next.js papers site for papers.zenlm.org
1 parent edef4fd commit b8e7efc

18 files changed

Lines changed: 2714 additions & 0 deletions

.github/workflows/deploy-site.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Papers Site
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'site/**'
8+
- '.github/workflows/deploy-site.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
- run: cd site && npm ci && npm run build
29+
env:
30+
NEXT_PUBLIC_BRAND: zen
31+
- uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: site/out
34+
35+
deploy:
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
runs-on: ubuntu-latest
40+
needs: build
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

site/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_BRAND=zen

site/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.next/
2+
out/
3+
node_modules/

site/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

site/next.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
output: 'export',
4+
images: {
5+
unoptimized: true,
6+
},
7+
trailingSlash: true,
8+
// Base path will be set via environment variable for different deployments
9+
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
10+
// Asset prefix for GitHub Pages
11+
assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH || '',
12+
}
13+
14+
module.exports = nextConfig

0 commit comments

Comments
 (0)