Skip to content

Commit c9ec95f

Browse files
committed
Fix build issue
1 parent a05be90 commit c9ec95f

10 files changed

Lines changed: 110 additions & 188 deletions

File tree

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.next
3+
out
4+
.git
5+
npm-debug.log*
6+
yarn-error.log*
7+
.DS_Store

.github/workflows/nextjs.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,16 @@ concurrency:
1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20-
env:
21-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2220
steps:
2321
- name: Checkout
2422
uses: actions/checkout@v4.2.2
2523

26-
- name: Detect package manager
27-
id: detect-package-manager
28-
run: |
29-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
30-
echo "manager=yarn" >> $GITHUB_OUTPUT
31-
echo "command=install" >> $GITHUB_OUTPUT
32-
echo "runner=yarn" >> $GITHUB_OUTPUT
33-
exit 0
34-
elif [ -f "${{ github.workspace }}/package.json" ]; then
35-
echo "manager=npm" >> $GITHUB_OUTPUT
36-
echo "command=ci" >> $GITHUB_OUTPUT
37-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
38-
exit 0
39-
else
40-
echo "Unable to determine package manager"
41-
exit 1
42-
fi
43-
4424
- name: Setup Node
4525
uses: actions/setup-node@v4.1.0
4626
with:
47-
node-version: '20'
48-
cache: ${{ steps.detect-package-manager.outputs.manager }}
27+
node-version-file: '.nvmrc'
28+
cache: 'npm'
29+
cache-dependency-path: 'package-lock.json'
4930

5031
- name: Setup Pages
5132
uses: actions/configure-pages@v5.0.0
@@ -60,10 +41,10 @@ jobs:
6041
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
6142
6243
- name: Install dependencies
63-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
44+
run: npm ci
6445

6546
- name: Build with Next.js
66-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
47+
run: npm run build
6748

6849
- name: Upload artifact
6950
uses: actions/upload-pages-artifact@v3.0.0

Dockerfile.ci

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:20-bookworm-slim
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
RUN npm run build

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.PHONY: help install ci lint build check docker-ci
2+
3+
NPM10 := npx -y npm@10.8.2
4+
DOCKER_IMAGE := devfest2026-ci
5+
6+
help:
7+
@echo "Targets:"
8+
@echo " make install - Install deps with npm 10 (CI parity)"
9+
@echo " make ci - Run npm 10 clean install"
10+
@echo " make lint - Run ESLint"
11+
@echo " make build - Build Next.js app"
12+
@echo " make check - Run ci + lint + build"
13+
@echo " make docker-ci - Build CI parity Docker image"
14+
15+
install: ci
16+
17+
ci:
18+
$(NPM10) ci
19+
20+
lint:
21+
npm run lint
22+
23+
build:
24+
npm run build
25+
26+
check: ci lint build
27+
28+
docker-ci:
29+
docker build -f Dockerfile.ci -t $(DOCKER_IMAGE) .

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,21 @@ src/
5454
- Static export is enabled via `output: 'export'`.
5555
- `next.config.ts` automatically sets `basePath`/`assetPrefix` during GitHub Actions builds.
5656
- Workflow file: `.github/workflows/nextjs.yml`.
57+
58+
## CI parity check (local Docker)
59+
60+
To run the same install/build flow used in GitHub Actions:
61+
62+
```bash
63+
docker build -f Dockerfile.ci -t devfest2026-ci .
64+
```
65+
66+
## Makefile shortcuts
67+
68+
```bash
69+
make ci
70+
make lint
71+
make build
72+
make check
73+
make docker-ci
74+
```

0 commit comments

Comments
 (0)