Skip to content

Commit 8d893ab

Browse files
committed
feat: github pages publish
1 parent c5aa038 commit 8d893ab

3 files changed

Lines changed: 74 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
30+
- name: Setup pnpm
31+
uses: pnpm/action-setup@v2
32+
with:
33+
version: 8
34+
35+
- name: Get pnpm store directory
36+
shell: bash
37+
run: |
38+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
39+
40+
- name: Setup pnpm cache
41+
uses: actions/cache@v3
42+
with:
43+
path: ${{ env.STORE_PATH }}
44+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
45+
restore-keys: |
46+
${{ runner.os }}-pnpm-store-
47+
48+
- name: Install dependencies
49+
run: pnpm install
50+
51+
- name: Build with Next.js
52+
run: pnpm run build
53+
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v3
56+
with:
57+
path: ./out
58+
59+
deploy:
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
runs-on: ubuntu-latest
64+
needs: build
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4
69+

next.config.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ const withMDX = createMDX({
55
})
66
/** @type {import('next').NextConfig} */
77
const nextConfig = {
8-
output: 'standalone',
8+
output: 'export',
99
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
1010
images: {
11+
unoptimized: true, // Required for static export
1112
remotePatterns: [
12-
{
13+
{
1314
hostname: '*.unsplash.com',
1415
},
15-
{
16+
{
1617
hostname: '*.imgur.com',
1718
}
1819
]

public/.nojekyll

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

0 commit comments

Comments
 (0)