Skip to content

Commit 242c297

Browse files
committed
Add support for github pages
1 parent 337ac50 commit 242c297

5 files changed

Lines changed: 81 additions & 4 deletions

File tree

.github/workflows/deploy.yml

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

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
4+
output: "export",
55
};
66

77
export default nextConfig;

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"next": "15.3.3",
13+
"postcss": "^8.5.5",
1214
"react": "^19.0.0",
13-
"react-dom": "^19.0.0",
14-
"next": "15.3.3"
15+
"react-dom": "^19.0.0"
1516
},
1617
"devDependencies": {
1718
"typescript": "^5",

postcss.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const config = {
2-
plugins: ["@tailwindcss/postcss"],
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
},
35
};
46

57
export default config;

0 commit comments

Comments
 (0)