Skip to content

Commit 5b6e36a

Browse files
kunalsuriclaude
andcommitted
Fix Pages deploy: use explicit npm install workflow
withastro/action requires a committed lockfile and exits 1 at its "Check lockfiles" step when none exists. Replace it with setup-node + `npm install` + upload-pages-artifact so the site builds without a package-lock.json (which can't be generated until local npm is fixed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent cbf172e commit 5b6e36a

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,25 @@ jobs:
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v4
27-
- name: Install, build, and upload the site
28-
# Official Astro action: detects the package manager, runs the build,
29-
# and uploads the Pages artifact. Runs its own Node (default 24) — so
30-
# this succeeds regardless of the local machine's toolchain.
31-
uses: withastro/action@v3
32-
# with:
33-
# path: . # root of the Astro project
34-
# node-version: 24 # override if needed
35-
# package-manager: npm
27+
28+
- name: Set up Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 24
32+
33+
# Plain `npm install` (not `npm ci`) so this works WITHOUT a committed
34+
# package-lock.json. Once local npm is fixed, commit the generated
35+
# lockfile and this becomes fully reproducible.
36+
- name: Install dependencies
37+
run: npm install
38+
39+
- name: Build site
40+
run: npm run build
41+
42+
- name: Upload Pages artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: ./dist
3646

3747
deploy:
3848
needs: build

0 commit comments

Comments
 (0)