Skip to content

Commit e7f30e6

Browse files
afuchereca-agent
andauthored
CI: fix docs-deploy Node version for Astro build (#111)
The deploy workflow ran the library build (webpack, Node 20) and the Astro website build in the same job under node-version 20, causing Astro to fail with "Node.js v20 is not supported". A single job can only run one Node version, so split the build job: - build-library (Node 20): builds the webpack bundle and uploads it as a GitHub Actions artifact - build-website (Node 22): downloads the bundle, copies it into website/public/, installs website deps, builds the Astro site, and uploads the Pages artifact - deploy: now depends on build-website (unchanged otherwise) 🤖 Generated with [eca](https://eca.dev) Co-authored-by: eca <git@eca.dev>
1 parent 0fcd87c commit e7f30e6

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/docs-deploy.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: false
2020

2121
jobs:
22-
build:
22+
build-library:
2323
runs-on: ubuntu-22.04
2424
steps:
2525
- name: Checkout
@@ -36,6 +36,30 @@ jobs:
3636
- name: Build library
3737
run: npm run build
3838

39+
- name: Upload library bundle
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: astrochart-bundle
43+
path: dist/astrochart.js
44+
45+
build-website:
46+
needs: build-library
47+
runs-on: ubuntu-22.04
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Set up Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
57+
- name: Download library bundle
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: astrochart-bundle
61+
path: dist
62+
3963
- name: Copy bundle to website
4064
run: cp dist/astrochart.js website/public/astrochart.js
4165

@@ -53,7 +77,7 @@ jobs:
5377
path: website/dist
5478

5579
deploy:
56-
needs: build
80+
needs: build-website
5781
runs-on: ubuntu-22.04
5882
environment:
5983
name: github-pages

0 commit comments

Comments
 (0)