Skip to content

Commit 3790ad0

Browse files
committed
deploy to gh pages
1 parent 79883ef commit 3790ad0

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This file was taken from https://github.com/nextjs/deploy-github-pages/blob/main/.github/workflows/deploy.yml
2+
name: Deploy Next.js site to Pages
3+
4+
on:
5+
# Runs on pushes targeting the main branch
6+
push:
7+
branches:
8+
- main
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: 'pages'
23+
cancel-in-progress: false
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- uses: pnpm/action-setup@v4
33+
name: Install pnpm
34+
with:
35+
version: 10
36+
run_install: false
37+
38+
- name: Install Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 22
42+
cache: 'pnpm'
43+
44+
- name: Install dependencies
45+
run: pnpm install
46+
47+
- name: Setup Pages
48+
id: setup_pages
49+
uses: actions/configure-pages@v5
50+
51+
- name: Restore cache
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
.next/cache
56+
# Generate a new cache whenever packages or source files change.
57+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
58+
# If source files changed but packages didn't, rebuild from a prior cache.
59+
restore-keys: |
60+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
61+
62+
- name: Build with Next.js
63+
run: pnpm run build
64+
env:
65+
PAGES_BASE_PATH: ${{ steps.setup_pages.outputs.base_path }}
66+
67+
- name: Upload artifact
68+
uses: actions/upload-pages-artifact@v3
69+
with:
70+
path: ./out
71+
72+
deploy:
73+
environment:
74+
name: github-pages
75+
url: ${{ steps.deployment.outputs.page_url }}
76+
runs-on: ubuntu-latest
77+
needs: build
78+
steps:
79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import createMDX from '@next/mdx';
44
const nextConfig: NextConfig = {
55
/* config options here */
66
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
7+
output: 'export',
78
};
89

910
const withMDX = createMDX({

0 commit comments

Comments
 (0)