Skip to content

Commit b6d03e7

Browse files
authored
Merge pull request #2 from StarOne01/copilot/add-ci-cd-for-bun-deploy
Configure CI/CD workflow to use Bun for GitHub Pages deployment
2 parents 7701c60 + 1b78b37 commit b6d03e7

2 files changed

Lines changed: 8 additions & 20 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,10 @@ jobs:
3131
steps:
3232
- name: Checkout
3333
uses: actions/checkout@v4
34-
- name: Detect package manager
35-
id: detect-package-manager
36-
run: |
37-
if [ -f "${{ github.workspace }}/bun.lock" ]; then
38-
echo "manager=bun" >> $GITHUB_OUTPUT
39-
echo "command=install" >> $GITHUB_OUTPUT
40-
echo "runner=bun" >> $GITHUB_OUTPUT
41-
exit 0
42-
else
43-
echo "Unable to determine package manager"
44-
exit 1
45-
fi
46-
- name: Setup Node
47-
uses: actions/setup-node@v4
34+
- name: Setup Bun
35+
uses: oven-sh/setup-bun@v2
4836
with:
49-
node-version: "20"
50-
cache: ${{ steps.detect-package-manager.outputs.manager }}
37+
bun-version: "1.1.38"
5138
- name: Setup Pages
5239
uses: actions/configure-pages@v5
5340
with:
@@ -62,14 +49,14 @@ jobs:
6249
path: |
6350
.next/cache
6451
# Generate a new cache whenever packages or source files change.
65-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/bun.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
52+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
6653
# If source files changed but packages didn't, rebuild from a prior cache.
6754
restore-keys: |
68-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/bun.lock') }}-
55+
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-
6956
- name: Install dependencies
70-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
57+
run: bun install
7158
- name: Build with Next.js
72-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
59+
run: bun run build
7360
- name: Upload artifact
7461
uses: actions/upload-pages-artifact@v3
7562
with:

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
reactStrictMode: true,
4+
output: 'export',
45
distDir: 'dist',
56
};
67
module.exports = nextConfig;

0 commit comments

Comments
 (0)