Skip to content

Commit da9f17a

Browse files
committed
feat: 配置 GitHub Pages 部署
1 parent d5d98aa commit da9f17a

File tree

2 files changed

+61
-8
lines changed

2 files changed

+61
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: 9
33+
34+
- name: Install dependencies
35+
working-directory: website
36+
run: pnpm install
37+
38+
- name: Build
39+
working-directory: website
40+
run: pnpm build
41+
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: website/out
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

website/next.config.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
reactStrictMode: true,
4+
output: 'export',
5+
basePath: '/skill',
46
images: {
57
domains: ['images.unsplash.com', 'picsum.photos'],
68
unoptimized: true,
79
},
8-
async rewrites() {
9-
return [
10-
{
11-
source: '/api/:path*',
12-
destination: 'http://localhost:8000/api/:path*',
13-
},
14-
];
15-
},
1610
};
1711

1812
module.exports = nextConfig;

0 commit comments

Comments
 (0)